diff --git a/bin/volume.netbsd b/bin/volume.netbsd new file mode 100755 index 0000000..3ea0f74 --- /dev/null +++ b/bin/volume.netbsd @@ -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 diff --git a/bin/volume.pulseaudio b/bin/volume.pulseaudio new file mode 100755 index 0000000..c8cc2ff --- /dev/null +++ b/bin/volume.pulseaudio @@ -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