Skip to content

Instantly share code, notes, and snippets.

@Davidblkx
Created September 6, 2019 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Davidblkx/92b71914a0730080e284f54075ca6ce7 to your computer and use it in GitHub Desktop.
Save Davidblkx/92b71914a0730080e284f54075ca6ce7 to your computer and use it in GitHub Desktop.
grabs and print the current playing song
#!/bin/bash
pacmd list-sink-inputs |\
grep media.name |\
sed -n -e 's/^.*media\.name = //p' |\
sed 's/"//g' |\
sed "s/'//g" |\
sed 's/playback stream//ig' |\
sed 's/playback//ig' |\
sed 's/AudioCallbackDriver//ig' |\
sed 's/AudioStream//ig' |\
sed '/^\s*$/d' |\
sed -n '1p' |\
cut -c 1-75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment