aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xherbstluftwm/.config/herbstluftwm/panel_indicators.sh11
1 files changed, 8 insertions, 3 deletions
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()
12 # Music 12 # Music
13 mpd_status=$(mpc | sed -nr "s/^\[(.*)\].*$/\1/p") 13 mpd_status=$(mpc | sed -nr "s/^\[(.*)\].*$/\1/p")
14 if [ $mpd_status = "playing" ]; then 14 if [ $mpd_status = "playing" ]; then
15 player_title=$(mpc -f "%title%" current)
16 player_artist=$(mpc -f "%artist%" current) 15 player_artist=$(mpc -f "%artist%" current)
16 player_title=$(mpc -f "%title%" current)
17 if [ -n "$player_artist" ]; then 17 if [ -n "$player_artist" ]; then
18 playing="$player_title - $player_artist" 18 playing="$player_artist - $player_title"
19 else 19 else
20 playing="$player_title" 20 playing="$player_title"
21 fi 21 fi
22 elif [ $(playerctl status) = "Playing" ]; then 22 elif [ $(playerctl status) = "Playing" ]; then
23 player_artist=$(playerctl metadata artist) 23 player_artist=$(playerctl metadata artist)
24 player_title=$(playerctl metadata title) 24 player_title=$(playerctl metadata title)
25 playing="$player_title - $player_artist" 25 if [ -n "$player_artist" ] && [ -n "$player_title" ]; then
26 playing="$player_artist - $player_title"
27 else
28 now_playing=$(playerctl metadata vlc:nowplaying)
29 playing="$now_playing"
30 fi
26 else 31 else
27 playing="" 32 playing=""
28 fi 33 fi