From 6f3baf9debbe96b83e49f7be2728a3b6d4ade58b Mon Sep 17 00:00:00 2001 From: Eric Phillips Date: Mon, 25 May 2015 18:51:34 -0600 Subject: [PATCH] added volume and mute --- dwmstatus.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dwmstatus.sh b/dwmstatus.sh index 76d87ec..394a9cd 100755 --- a/dwmstatus.sh +++ b/dwmstatus.sh @@ -24,6 +24,7 @@ glyph_clk="\u01Af" glyph_bln="\u01AA" glyph_msc="\u01AB" glyph_vol="\u01AC" +glyph_mute="\u01B4" glyph_mail="\u01AD" glyph_wifi="\u01AE" @@ -39,15 +40,29 @@ msc(){ echo -ne "${glyph_msc} ${song_info}" } +#Date dte(){ datetime="$(date "+%F %T")" echo -ne "${glyph_clk} ${datetime}" } +#Power and Battery bat(){ charge=`acpi -b | awk '{print +$4}'` echo -ne "${glyph_pow} ${charge}%" } + +#Volume +vol(){ + mute=`amixer get Master | grep "Front Left:" | awk '{print $6}'` + if [ ${mute} == "[on]" ] + then + volume=`amixer get Master | grep "Front Left:" | awk '{print $5}' | tr -d '[]'` + echo -ne "${glyph_vol} ${volume}" + else + echo -ne "${glyph_mute}" + fi +} # Pipe to statusbar -xsetroot -name "$(msc) $(bat) $(dte) " +xsetroot -name "$(msc) $(vol) $(bat) $(dte) "