17 lines
619 B
Bash
Executable File
17 lines
619 B
Bash
Executable File
#!/bin/sh
|
|
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
|