You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
492 B
30 lines
492 B
#!/bin/bash |
|
set -x |
|
cmd=$1 |
|
|
|
sink=$VOLCTL_SINK |
|
|
|
# if VOLCTL_SINK is not set, use the sink that was most recently connected |
|
if [ -z "$sink" ]; then |
|
NUM=${VOLCTL_SINK_NUM:-1} |
|
sink=$(pactl list sinks | grep "Name:" | awk '{print $2}' | sed "${NUM}q;d") |
|
fi |
|
|
|
case $cmd in |
|
|
|
up | u) |
|
pactl set-sink-volume $sink +5% |
|
;; |
|
|
|
down | d) |
|
pactl set-sink-volume $sink -5% |
|
;; |
|
|
|
toggle | t) |
|
pactl set-sink-mute $sink toggle |
|
;; |
|
|
|
*) |
|
echo -n "unknown command: $cmd" |
|
;; |
|
esac
|
|
|