Skip to content

Instantly share code, notes, and snippets.

@yzdann
Last active November 30, 2020 10:56
Show Gist options
  • Save yzdann/3b52bf6f187628b7268813a23a0d3150 to your computer and use it in GitHub Desktop.
Save yzdann/3b52bf6f187628b7268813a23a0d3150 to your computer and use it in GitHub Desktop.
if [[ $(spotifycli --status) ]]; then
SONG=$(spotifycli --song)
SPOTIFY_WINDOWD_ID=$(wmctrl -l | grep -i "$SONG" | head -1 | awk '{ print $1 }')
echo "<img>/home/yzdann/.scripts/spotify.png</img><click>wmctrl -i -a $SPOTIFY_WINDOWD_ID</click>"
else
echo "<img>/home/yzdann/.scripts/spotify-gray.png</img><click>spotify %U</click>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment