scripts: Add unified volume bars to control scripts

`control-brightness` and `control-volume` both now have the exact same
progress bar indicator.
Additionally, by using the same dunst 'stack' they replace each other if
invoked in quick succession, which I really like.
This commit is contained in:
Marty Oehme 2021-03-17 15:06:02 +01:00
parent a6b3a973bb
commit 5ce6111f51
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 10 additions and 5 deletions

View file

@ -54,13 +54,16 @@ send_notification() {
fi
vol="$(get_volume)"
bar=$(seq -s "─" $((vol / 5)) | sed 's/[0-9]//g')
if [ "$vol" -eq 0 ] || [ "$(get_mute)" = "off" ]; then
# Show the sound muted notification
$notcmd -a "changeVolume" -u low -i audio-volume-muted "Volume muted"
else
# Show the volume notification
$notcmd -a "changeVolume" -u low -i audio-volume-high \
-h int:value:"$vol" "Volume: $vol%"
-h int:value:"$vol" "Volume: $vol%
$bar"
fi
}