Skip to content

Instantly share code, notes, and snippets.

@omerk
Created October 3, 2011 16:32
Show Gist options
  • Save omerk/1259533 to your computer and use it in GitHub Desktop.
Save omerk/1259533 to your computer and use it in GitHub Desktop.
Spotify 'Now Playing'
#!/bin/bash
pgrep spotify 1>/dev/null 2>&1
if [ $? != 0 ]; then
exit 1
fi
xwininfo -root -tree | grep "Spotify -" | sed 's/[ ]*0x[0-9a-f]* "Spotify - \(.*\)": ("spotify" "Spotify").*/\1/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment