From 22113dada7aedf4f203996d1e32a937a8684af55 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Fri, 28 Aug 2015 17:10:03 +0000 Subject: [PATCH] added music progress indicator --- lemonbar.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lemonbar.sh b/lemonbar.sh index 6c9149c..063c159 100755 --- a/lemonbar.sh +++ b/lemonbar.sh @@ -30,8 +30,12 @@ getVolume() { } getMPD(){ + MPD1=$(mpc | cut -d$'\n' -f1) + MPD2=$(mpc | cut -d$'\n' -f2) + PERC=$(echo "$(echo $MPD2 | cut -d ' ' -f4 | cut -b2-3 | cut -d '%' -f1) 0 100" | spark | tail -n 1 | cut -b1-3) + #PERC=$(echo "$(echo $MPD2 | cut -d ' ' -f4 | cut -b2-3 | cut -d '%' -f1) 0 100" | spark | cut -b 1-3) if [ "$(mpc | wc -l)" -gt 1 ]; then - echo -n "%{F$BLUE}♫ %{F$BROWN}$(mpc | cut -d$'\n' -f1) %{F$BLUE}♫ %{F$GREY}$(mpc | cut -d$'\n' -f2 | cut -d ' ' -f1,2,4)" + echo -n "%{F$BLUE}♫ %{F$BROWN}$MPD1 %{F$BLUE}♫ $PERC %{F$GREY}$(echo -n $MPD2 | cut -d ' ' -f1,2)" fi }