added volume and mute

This commit is contained in:
2015-05-25 18:51:34 -06:00
parent 30b8a0a740
commit 6f3baf9deb
+16 -1
View File
@@ -24,6 +24,7 @@ glyph_clk="\u01Af"
glyph_bln="\u01AA" glyph_bln="\u01AA"
glyph_msc="\u01AB" glyph_msc="\u01AB"
glyph_vol="\u01AC" glyph_vol="\u01AC"
glyph_mute="\u01B4"
glyph_mail="\u01AD" glyph_mail="\u01AD"
glyph_wifi="\u01AE" glyph_wifi="\u01AE"
@@ -39,15 +40,29 @@ msc(){
echo -ne "${glyph_msc} ${song_info}" echo -ne "${glyph_msc} ${song_info}"
} }
#Date
dte(){ dte(){
datetime="$(date "+%F %T")" datetime="$(date "+%F %T")"
echo -ne "${glyph_clk} ${datetime}" echo -ne "${glyph_clk} ${datetime}"
} }
#Power and Battery
bat(){ bat(){
charge=`acpi -b | awk '{print +$4}'` charge=`acpi -b | awk '{print +$4}'`
echo -ne "${glyph_pow} ${charge}%" 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 # Pipe to statusbar
xsetroot -name "$(msc) $(bat) $(dte) " xsetroot -name "$(msc) $(vol) $(bat) $(dte) "