Created
January 16, 2022 17:17
-
-
Save nivit/32465f934fac782c255ef0c019e2a25f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
chroot_path=/compat/ubuntu | |
get_pa_sock_path() | |
{ | |
PA_SOCK_PATH=$(sockstat | awk -v me=$(whoami) -F'[ \t]+' ' | |
$1 == me && $2 == "pulseaudio" && $6 ~ /native/ { | |
print $6; | |
exit 0 | |
}' | |
) | |
} | |
get_pa_sock_path | |
if [ ! -S "$PA_SOCK_PATH" ]; then | |
while killall pulseaudio; do | |
sleep 0.5 | |
done | |
pulseaudio --start | |
get_pa_sock_path | |
fi | |
[ -S "$PA_SOCK_PATH" ] && export PULSE_SERVER=unix:$PA_SOCK_PATH | |
${chroot_path}/usr/bin/spotify | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment