all repos — dotfiles @ e127293d9be6179083d08c51c0578d72cf51b6af

my *nix dotfiles

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
commit

e127293d9be6179083d08c51c0578d72cf51b6af

parent

a57181c9c58dddc216a13cf81faad537e0c7069d

1 files changed, 7 insertions(+), 2 deletions(-)

jump to
M bin/vol.shbin/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