commit b1bfe7c26e269cbbc4c23c4a160b93e73d2ca1ad parent eb67f9e628485c0d5e666d053e8a1943aaf6d7da Author: Jacob R. Edwards <n/a> Date: Mon, 1 Nov 2021 13:20:54 -0700 Use volume levels of 0-100 instead of 0-1 More precision isn't needed and it's easier to type. Diffstat:
| M | local/bin/bin/vol | | | 14 | ++++++++++---- |
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/local/bin/bin/vol b/local/bin/bin/vol @@ -1,6 +1,12 @@ #!/bin/sh +# Copyright 2021 Jacob R. Edwards +# Hoc should be replaced by bc (I don't understand the scale variable) -vol=$(sndioctl -n output.level) -test $# -gt 0 && - sndioctl -q output.level="$1" -echo "vol $vol" +vol=$(hoc -e "int($(sndioctl -n output.level)*100)") +if test $# -gt 0 +then + sign=${1%%[!+-]*} + num=${1#[+-]} + sndioctl -q output.level=$sign$(hoc -e "$num/100") +fi +echo vol $vol