NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Script to easily manipulate audio volume in NetBSD.



On Wed Mar 25, 2026 at 11:09 PM MDT, Isac Monção wrote:
I created a script to help those who use a window manager and need a
simple way to increase, decrease and get the current audio volume.

I like your script. Thank you for sharing.

Minor nit: perhaps an sh(1) case statement would be better than your ifs, so:

```sh
case "$1" in
up)   mixerctl -w "$MIXER_VARIABLE+=$INCREMENT" ;;
down) mixerctl -w "$MIXER_VARIABLE-=$INCREMENT" ;;
#etc
*)    usage; exit 64 ;; # sysexits(3) EX_USAGE if i recall
esac
```

This would also cover the case of $# -lt 1, though you might still find
something like `test -n "$2" && usage && exit 64` necessary.

happy hacking
trinity



Home | Main Index | Thread Index | Old Index