bin/vol.sh: Indicate mute status Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Sat, 14 Sep 2019 18:02:16 +0530
1 files changed,
7 insertions(+),
2 deletions(-)
jump to
M
bin/vol.sh
→
bin/vol.sh
@@ -14,8 +14,13 @@ d)
amixer sset Master 2%- ;; q) - cur_vol=$(amixer get Master | grep 'Right' | awk -F'[][]' '{ print $2 }' | tr -d '\n') - echo -ne "%{F$light}vol %{F$fg}$cur_vol" + if [[ $(amixer get Master | grep 'Right' | awk -F'[][] ' '{ print $2 }' | tr -d '\n') = "[on]" ]] + then + cur_vol=$(amixer get Master | grep 'Right' | awk -F'[][]' '{ print $2 }' | tr -d '\n') + echo -ne "%{F$light}vol %{F$fg}$cur_vol" + else + echo -ne "%{F$light}vol %{F$fg}muted" + fi ;; esac done