From 1732dc5308946db377f6ec105756f5a720cd4b8c Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Thu, 11 May 2017 15:48:41 +0200 Subject: [PATCH] Add script for querying banshee --- tmux/banshee.sh | 9 +++++++++ tmux/theme.sh | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 tmux/banshee.sh diff --git a/tmux/banshee.sh b/tmux/banshee.sh new file mode 100755 index 0000000..205bb40 --- /dev/null +++ b/tmux/banshee.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Check if banshee exists +hash banshee 2>/dev/null || exit 1 + +ARTIST=$(banshee --query-artist | awk '{$1=""; print substr($0,2)}') +TITLE=$(banshee --query-title | awk '{$1=""; print substr($0,2)}') + +echo "$TITLE - $ARTIST" diff --git a/tmux/theme.sh b/tmux/theme.sh index 707eabc..53e205a 100644 --- a/tmux/theme.sh +++ b/tmux/theme.sh @@ -51,6 +51,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_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" @@ -58,4 +59,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_battery' '$tm_date' '$tm_host +set -g status-right $tm_banshee' '$tm_battery' '$tm_date' '$tm_host