herbstluftwm: panel: make volume bar clickable
This commit is contained in:
parent
d44f2c4f90
commit
86c9b1bb72
1 changed files with 6 additions and 2 deletions
|
|
@ -111,11 +111,15 @@ function battery() {
|
|||
# VOLUME
|
||||
function volume() {
|
||||
vol=$(amixer get Master | grep "%" | head -n1 | awk -F"[][]" '{if($6~"off"){print "0%";} else {print $2;}}' | tr -d '%')
|
||||
echo -n "^ca(1, amixer -q set Master 5%- && herbstclient emit_hook update)"
|
||||
echo -n "^ca(2, amixer -q set Master toggle && herbstclient emit_hook update)"
|
||||
echo -n "^ca(3, amixer -q set Master 5%+ && herbstclient emit_hook update)"
|
||||
if [[ $vol -le 0 ]]; then
|
||||
echo -n $(icon volume_off grey) $(echo $vol | dzen2-gdbar -s o -nonl)
|
||||
echo -n $(icon volume_off grey)
|
||||
else
|
||||
echo -n $(icon volume_on white) $(echo $vol | dzen2-gdbar -s o -nonl)
|
||||
echo -n $(icon volume_on white)
|
||||
fi
|
||||
echo -n " $(echo $vol | dzen2-gdbar -s o -nonl)^ca()^ca()^ca()"
|
||||
}
|
||||
|
||||
hc pad $monitor $panel_height
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue