dot_testing/sh/vol

20 lines
343 B
Plaintext
Raw Normal View History

2021-05-11 21:53:13 -05:00
#!/bin/sh
2022-06-18 16:34:35 -05:00
pulse=$(ps aux | grep pulseaudio | wc -l)
[ "$1" = "inc" ] && sign="+"
[ "$1" = "dec" ] && sign="-"
[ "$#" -eq 0 ] && exit 1
if [ "$pulse" -eq 2 ]; then
for SINK in `pacmd list-sinks | grep 'index:' | cut -b12-`
do
pactl set-sink-volume $SINK "${sign}5%"
done
else
amixer -c 0 set Master "5%${sign}"
fi
killall -12 status