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.

Revisions

  1. yzdann revised this gist Nov 30, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions spotify-genmon.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    SPOTIFY_WINDOWD_ID=$(wmctrl -l | grep -i "spotify free" | head -1 | awk '{ print $1 }')

    if [[ "$SPOTIFY_WINDOWD_ID" ]]; then
    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>"
  2. yzdann created this gist Nov 30, 2020.
    7 changes: 7 additions & 0 deletions spotify-genmon.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    SPOTIFY_WINDOWD_ID=$(wmctrl -l | grep -i "spotify free" | head -1 | awk '{ print $1 }')

    if [[ "$SPOTIFY_WINDOWD_ID" ]]; then
    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