commit f98b232e26b24fd050336e50f9af3ec93a93e2a8
parent 5db1bb41cf8a0aa932d9aca0d24261730946f347
Author: hhvn <dev@hhvn.uk>
Date: Sun, 27 Nov 2022 21:33:55 +0000
Use sndioctl on linux
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/.scripts/hvol b/.scripts/hvol
@@ -1,7 +1,6 @@
#!/bin/sh
-[ "$(uname)" = "Linux" ] && amixer set Master "$1"
-[ "$(uname)" = "OpenBSD" ] && {
+command -v sndioctl >/dev/null && {
echo "$1" | grep '%' >/dev/null && {
case "$(echo "$1" | sed -E 's/.*(.)$/\1/')" in
"+") t="+" ;;
@@ -28,7 +27,7 @@
;;
*) sndioctl output.level=$1 ;;
esac
-}
+} || amixer set Master "$1"
block=$($HOME/.scripts/dwmbar/vol)
printf '%s' "$block" > /tmp/blocks/vol