diff --git a/tmux/clementine.sh b/tmux/clementine.sh new file mode 100755 index 0000000..1549fd7 --- /dev/null +++ b/tmux/clementine.sh @@ -0,0 +1,5 @@ +if hash clementine 2>/dev/null && pgrep clementine > /dev/null; then + ARTIST=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'xesam:artist: ' | cut -c15-) + TITLE=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'xesam:title: ' | cut -c14-) + echo "$ARTIST - $TITLE" +fi diff --git a/tmux/theme.sh b/tmux/theme.sh index d3c3426..df6b450 100644 --- a/tmux/theme.sh +++ b/tmux/theme.sh @@ -52,6 +52,7 @@ set-window-option -g clock-mode-colour $tm_color_active #tm_tunes="#[fg=$tm_color_music]#(osascript ~/.dotfiles/applescripts/tunes.scpt)" #tm_battery="#(~/.dotfiles/bin/battery_indicator.sh)" #tm_banshee="#[fg=$tm_color_music]#($HOME/.dotfiles/tmux/banshee.sh)" +tm_clementine="#[fg=$tm_color_music]#($HOME/.dotfiles/tmux/clementine.sh)" tm_battery="#[fg=$tm_color_inactive]#(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk '{print $2}')" tm_date="#[fg=$tm_color_inactive] %R %d %b" @@ -59,4 +60,4 @@ tm_host="#[fg=$tm_color_feature,bold]#h" tm_session_name="#[fg=$tm_color_feature,bold]$tm_icon #S" set -g status-left $tm_session_name' ' -set -g status-right $tm_banshee' '$tm_battery' '$tm_date' '$tm_host +set -g status-right $tm_clementine' '$tm_battery' '$tm_date' '$tm_host