Skip to content

Instantly share code, notes, and snippets.

@blotta
Created September 9, 2017 01:34
Show Gist options
  • Save blotta/a58a31987d73ec8098a44b27cc8c6fce to your computer and use it in GitHub Desktop.
Save blotta/a58a31987d73ec8098a44b27cc8c6fce to your computer and use it in GitHub Desktop.
Spotify running on Docker. Tested on Arch Linux with X and Pulseaudio
#!/bin/bash
KEY=$(xauth list | grep $(hostname) | awk '{ print $3 }' | head -n 1)
DCK_HOST=docker-spotify
xauth add $DCK_HOST/unix:0 . $KEY
docker run -it --rm \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.Xauthority:/tmp/.Xauthority \
-e DISPLAY=unix$DISPLAY \
-e XAUTHORITY=/tmp/.Xauthority \
-h $DCK_HOST \
--device /dev/snd:/dev/snd \
-e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
-v ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native \
--group-add $(getent group audio | cut -d: -f3) \
--name spotify \
jess/spotify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment