pkgs: add change-audio

This commit is contained in:
Bruno BELANYI 2021-11-04 15:56:01 +01:00
parent 10b8ee50c1
commit f987e79d17
3 changed files with 63 additions and 0 deletions

17
pkgs/change-audio/change-audio Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$1" = "up" ]; then
upDown="-i"
else
upDown="-d"
fi
pamixer --allow-boost "$upDown" "$2"
newVolume="$(pamixer --get-volume)"
notify-send -u low \
-h string:x-canonical-private-synchronous:change-audio \
-h "int:value:$newVolume" \
-- "Set volume to $newVolume%"