Created
January 9, 2017 22:47
-
-
Save MoOmEeN/2f0e10415b37c2763275a8e0573b2d79 to your computer and use it in GitHub Desktop.
Show now playing song from spotify in tmux powerline on elementary linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__np_spotify_elementary() { | |
[ ! shell_is_linux ] && return 1 | |
spotify_ids=$(xwininfo -root -tree | grep '("spotify' | cut -f1 -d'"' | sed 's/ //g') | |
for spotify_id in $spotify_ids | |
do | |
title=$(xwininfo -id "$spotify_id" | grep "xwininfo" | grep -Po "(?<=\").*(?=\"$)") | |
if [ "$title" != "spotify" ]; then | |
echo $title | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment