From bb6ee39ef8f724724d205f674434dcf5f3e56f57 Mon Sep 17 00:00:00 2001 From: whut Date: Sun, 18 Apr 2021 16:50:43 -0500 Subject: [PATCH] now shows current song --- tooner.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tooner.sh b/tooner.sh index 7120519..65d4b59 100755 --- a/tooner.sh +++ b/tooner.sh @@ -1,6 +1,8 @@ #!/bin/bash -! pgrep mpd && mpd +! pgrep mpd > /dev/null && mpd lastFile=/tmp/radioLast.$USER +nowPlaying=`mpc current -f "[%artist% - ]%title%"` +width=$((${#nowPlaying} > 30 ? ${#nowPlaying} : 30)) if [ $# -eq 0 ]; then stationFile=~/.stations @@ -30,7 +32,7 @@ done [ "${#names[@]}" -lt 10 ] && l=${#names[@]} || l=10 -choice=`echo "${names[*]}" | rofi -i -dmenu -format i -l $l -width -30 -location 7 -theme android_notification -p "Radio" -no-custom -select $last` +choice=`echo "${names[*]}" | rofi -i -dmenu -format i -mesg "$nowPlaying" -l $l -width -$width -location 7 -theme android_notification -p "Radio" -no-custom -select $last` if [ ! -z "$choice" ]; then mpc clear