sound.pulse.cookie

sound.pulse

cookie(getenv, read) -> cookie

Read the client's cookie

getenv reads a variable, os.getenv by default; read reads a file, std.fs.read_file by default. The first of $PULSE_COOKIE, pulse/cookie under $XDG_CONFIG_HOME (else $HOME/.config), and $HOME/.pulse-cookie that holds 256 bytes, libpulse's order. Returns nil when none does. The device then sends zeros: a server takes a client of its own uid by the socket's credentials, and pipewire-pulse never reads the cookie.