24 lines
389 B
Text
24 lines
389 B
Text
|
#!/bin/bash
|
||
|
sink=$(pactl list sinks | grep -B 1 "State: RUNNING" | grep -oE '[0-9]*')
|
||
|
cmd=""
|
||
|
|
||
|
if [ -z "$sink" ]; then
|
||
|
echo "ERROR: invalid sink: \"$sink\""
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
case $1 in
|
||
|
d*)
|
||
|
pactl set-sink-volume $sink -5%
|
||
|
;;
|
||
|
i*)
|
||
|
pactl set-sink-volume $sink +5%
|
||
|
;;
|
||
|
m*)
|
||
|
pactl set-sink-mute $sink toggle
|
||
|
;;
|
||
|
*)
|
||
|
echo "ERROR: invalid command: \"$1\""
|
||
|
;;
|
||
|
esac
|