This repository has been archived on 2024-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
2023-10-29 15:34:13 +00:00
|
|
|
#!/bin/sh
|
2023-08-05 21:19:04 +01:00
|
|
|
pactl set-sink-mute @DEFAULT_SINK@ 0
|
|
|
|
if [ "$1" = "up" ]; then
|
|
|
|
if [ "$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')" = "100" ]; then
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
pactl set-sink-volume @DEFAULT_SINK@ +$2%
|
|
|
|
fi
|
|
|
|
elif [ "$1" = "down" ]; then
|
|
|
|
pactl set-sink-volume @DEFAULT_SINK@ -$2%
|
|
|
|
if [ "$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')" = "0" ]; then
|
|
|
|
pactl set-sink-mute @DEFAULT_SINK@ 1
|
|
|
|
else
|
|
|
|
pactl set-sink-mute @DEFAULT_SINK@ 0
|
|
|
|
fi
|
|
|
|
fi
|