herbstluftwm: panel: add volume bar
This commit is contained in:
parent
74599afa02
commit
a463820149
1 changed files with 11 additions and 1 deletions
|
|
@ -107,6 +107,16 @@ function battery() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# VOLUME
|
||||||
|
function volume() {
|
||||||
|
vol=$(amixer get Master | awk -F"[][]" '/dB/ {if($6~"off"){print "0%";} else {print $2;}}' | tr -d '%')
|
||||||
|
if [[ $vol -le 0 ]]; then
|
||||||
|
echo -n $(icon volume_off grey) $(echo $vol | dzen2-gdbar -nonl)
|
||||||
|
else
|
||||||
|
echo -n $(icon volume_on white) $(echo $vol | dzen2-gdbar -nonl)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
hc pad $monitor $panel_height
|
hc pad $monitor $panel_height
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -175,7 +185,7 @@ hc pad $monitor $panel_height
|
||||||
right=""
|
right=""
|
||||||
|
|
||||||
# custom functions
|
# custom functions
|
||||||
for func in cpu battery; do
|
for func in cpu volume battery; do
|
||||||
right="${right} $(${func})"
|
right="${right} $(${func})"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue