Browse Source

Add info from clementine to tmux status bar

coc
Schneider 7 years ago
parent
commit
3b08272a50
  1. 5
      tmux/clementine.sh
  2. 3
      tmux/theme.sh

5
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

3
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
Loading…
Cancel
Save