os/script/vol

20 lines
466 B
Text
Raw Permalink Normal View History

2023-06-06 17:14:33 +02:00
current=$(pactl get-sink-volume @DEFAULT_SINK@ | rg [0-9]+% -o | rg -o [0-9]+ | head -n 1)
case "$1" in
"raise" ) {
if [ $current -ge 95 ];
then pactl set-sink-volume @DEFAULT_SINK@ 100%
else pactl set-sink-volume @DEFAULT_SINK@ +5%
fi
};;
"lower" ) {
if [ $current -le 5 ];
then pactl set-sink-volume @DEFAULT_SINK@ 0%
else pactl set-sink-volume @DEFAULT_SINK@ -5%
fi
};;
"toggle" ) {
pactl set-sink-mute @DEFAULT_SINK@ toggle
};;
esac