1
0

fixing volume(1): separating out the system-dependent portions

This commit is contained in:
dtb 2022-08-21 15:58:26 -04:00
parent a998eb9ef7
commit 01fee33d0f
2 changed files with 38 additions and 0 deletions

18
bin/volume.netbsd Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh -e
# NetBSD 9.2 STABLE 2021-07
case "$1" in
a*)
audioctl -w play.gain=$2 >/dev/null
exit $?
;;
s*) # hacky
audioctl -a \
| grep "play\.gain" \
| cut -d '=' -f 2
exit $?
;;
esac
exit 1

20
bin/volume.pulseaudio Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh -e
# pactl 15.0 compiled+linked with libpulse 15.0.0
case "$argv1" in
a*)
pactl set-sink-volume @DEFAULT_SINK@ $2%
exit $?
;;
s*) # really hacky, gets the job done
# gets the volume % of Lchan specifically
pactl get-sink-volume @DEFAULT_SINK@ \
| sed q \
| cut -d '/' -f 2 \
| xargs echo \
| sed s/'%'//
;;
esac
exit 1