From 52a40f15945c1a2d0283aba7be40945c6f472749 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Thu, 12 Nov 2015 20:39:25 +0100 Subject: Added mpc support to panel --- herbstluftwm/.config/herbstluftwm/panel_indicators.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'herbstluftwm/.config') diff --git a/herbstluftwm/.config/herbstluftwm/panel_indicators.sh b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh index 6686d14..2a3d2e6 100755 --- a/herbstluftwm/.config/herbstluftwm/panel_indicators.sh +++ b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh @@ -12,17 +12,22 @@ music() # Music mpd_status=$(mpc | sed -nr "s/^\[(.*)\].*$/\1/p") if [ $mpd_status = "playing" ]; then - player_title=$(mpc -f "%title%" current) player_artist=$(mpc -f "%artist%" current) + player_title=$(mpc -f "%title%" current) if [ -n "$player_artist" ]; then - playing="$player_title - $player_artist" + playing="$player_artist - $player_title" else playing="$player_title" fi elif [ $(playerctl status) = "Playing" ]; then player_artist=$(playerctl metadata artist) player_title=$(playerctl metadata title) - playing="$player_title - $player_artist" + if [ -n "$player_artist" ] && [ -n "$player_title" ]; then + playing="$player_artist - $player_title" + else + now_playing=$(playerctl metadata vlc:nowplaying) + playing="$now_playing" + fi else playing="" fi -- cgit v1.2.3