diff options
| author | 2014-11-11 20:09:58 +0100 | |
|---|---|---|
| committer | 2014-11-11 20:09:58 +0100 | |
| commit | 9a52337e364545e4ce906b340e3d7aad55c0af7f (patch) | |
| tree | 91cca8bd65a27bb3bcf9bdf62c4b7b0cc95f2ad9 | |
| parent | 2f825d06e2ea48602fc9cc1ab58fce20355e53eb (diff) | |
| download | dotfiles-9a52337e364545e4ce906b340e3d7aad55c0af7f.tar.gz dotfiles-9a52337e364545e4ce906b340e3d7aad55c0af7f.tar.bz2 dotfiles-9a52337e364545e4ce906b340e3d7aad55c0af7f.zip | |
Music indicator scrolling now
| -rwxr-xr-x | herbstluftwm/.config/herbstluftwm/panel.sh | 13 |
1 files changed, 12 insertions, 1 deletions
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 | |||
| 66 | if [ $player_status = "Playing" ]; then | 66 | if [ $player_status = "Playing" ]; then |
| 67 | player_artist=$(playerctl metadata artist) | 67 | player_artist=$(playerctl metadata artist) |
| 68 | player_title=$(playerctl metadata title) | 68 | player_title=$(playerctl metadata title) |
| 69 | echo -e "music\tPlaying: $player_title - $player_artist" | 69 | playing="$player_title - $player_artist" |
| 70 | |||
| 71 | if [ "$current" != "$playing" ] ; then | ||
| 72 | current=$playing | ||
| 73 | scrolling=$current | ||
| 74 | elif [ ${#scrolling} -gt "24" ] ; then | ||
| 75 | scrolling=${scrolling:1} | ||
| 76 | else | ||
| 77 | scrolling=$current | ||
| 78 | fi | ||
| 79 | |||
| 80 | echo -e "music\tPlaying: ${scrolling:0:24}" | ||
| 70 | else | 81 | else |
| 71 | echo -e "music\toff" | 82 | echo -e "music\toff" |
| 72 | fi | 83 | fi |
