From 9a52337e364545e4ce906b340e3d7aad55c0af7f Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Tue, 11 Nov 2014 20:09:58 +0100 Subject: Music indicator scrolling now --- herbstluftwm/.config/herbstluftwm/panel.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/herbstluftwm/.config/herbstluftwm/panel.sh b/herbstluftwm/.config/herbstluftwm/panel.sh index 002877e..33ef886 100755 --- a/herbstluftwm/.config/herbstluftwm/panel.sh +++ b/herbstluftwm/.config/herbstluftwm/panel.sh @@ -66,7 +66,18 @@ fi if [ $player_status = "Playing" ]; then player_artist=$(playerctl metadata artist) player_title=$(playerctl metadata title) - echo -e "music\tPlaying: $player_title - $player_artist" + playing="$player_title - $player_artist" + + if [ "$current" != "$playing" ] ; then + current=$playing + scrolling=$current + elif [ ${#scrolling} -gt "24" ] ; then + scrolling=${scrolling:1} + else + scrolling=$current + fi + + echo -e "music\tPlaying: ${scrolling:0:24}" else echo -e "music\toff" fi -- cgit v1.2.3