feat(wpdef): default starred and put at the end

This commit is contained in:
ange 2025-04-30 10:08:34 +00:00
parent 6d06f7e307
commit 337c12125d
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
2 changed files with 26 additions and 35 deletions

View file

@ -1,25 +1,16 @@
#!/bin/bash -e
case "$1" in
s)
DEV='@DEFAULT_AUDIO_SINK@'
;;
m)
DEV='@DEFAULT_AUDIO_SOURCE@'
;;
*)
exit 1
;;
s) DEV='@DEFAULT_AUDIO_SINK@' ;;
m) DEV='@DEFAULT_AUDIO_SOURCE@' ;;
*) exit 1 ;;
esac
function update_vol() {
# shellcheck disable=SC2017
case "$1" in
+*|-*)
# shellcheck disable=SC2017
CUR=$((CUR + $1 - CUR % $1 + CUR % $1 * 10 / $1 / 5 * $1))
;;
*)
CUR="$1"
+*|-*) CUR=$((CUR + $1 - CUR % $1 + CUR % $1 * 10 / $1 / 5 * $1)) ;;
*) CUR="$1" ;;
esac
wpctl set-volume -l 3 "$DEV" "$CUR%"
}