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
|
||||
}
|
||||
|
||||
# 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
|
||||
|
||||
{
|
||||
|
|
@ -175,7 +185,7 @@ hc pad $monitor $panel_height
|
|||
right=""
|
||||
|
||||
# custom functions
|
||||
for func in cpu battery; do
|
||||
for func in cpu volume battery; do
|
||||
right="${right} $(${func})"
|
||||
done
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue