[bugfix] volume on ubuntu incorrect

This commit is contained in:
Klesh Wong 2020-11-02 10:59:07 +08:00
parent 5e5beeadd1
commit e89ad2a707

View File

@ -56,8 +56,9 @@ statusbar() {
# volume
amixer get Master | awk 'END {
ICO = $NF == "[off]" ? ENVIRON["ICON_MTD"] : ENVIRON["ICON_VOL"]
VOL = $(NF-1)
printf "%s %s ", ICO,substr(VOL, 2, length(VOL)-2)
match($0, / \[([0-9]+%)\] /, m)
VOL = m[1]
printf "%s %s ", ICO, VOL
}'
# network