fix: set-{light,vol} calculations

This commit is contained in:
AngeD 2023-02-15 08:02:00 +01:00
parent 2c856d8606
commit fdba17e7ff
6 changed files with 6 additions and 7 deletions

@ -1 +1 @@
Subproject commit 1712672e4da3003a0dd9f771d30389600b360f42
Subproject commit e20d77deac40e6e65d036acd60aff474c0f09282

@ -1 +1 @@
Subproject commit 76b2b1ff819f70466f4e75c83cad64892f78ad8d
Subproject commit 1fe908fb4acdcee26573e9ccde0de94ec77e5e84

@ -1 +1 @@
Subproject commit 2c2430d42f30d1aef8715aed933272c9a6898f4e
Subproject commit 160091db4cd340d4e195eaa79e8f28db0c12af83

@ -1 +1 @@
Subproject commit ed407466b8ae3c12c2f03da004d721618e64fd49
Subproject commit 69b5737daf0448ad7e6686174638be74f86afdec

View File

@ -18,14 +18,13 @@ set +e
CUR="$(cat "$CUR_FILE" || echo 50)"
set -e
CUR="$((CUR - CUR % "$1"))"
case "${1:0:1}" in
'')
exit 1
;;
'+'|'-')
NEW="$((CUR + "$1"))"
NEW="$((CUR - CUR % $1 + $1))"
;;
*)
NEW="$1"

View File

@ -6,7 +6,7 @@ SINK='@DEFAULT_AUDIO_SINK@'
if [ "$1" == 'm' ]; then
wpctl set-mute "$SINK" toggle
else
VOL="$((10#$(wpctl get-volume "$SINK" | tr -dc '[0-9]')))"
VOL="$((10#$(wpctl get-volume "$SINK" | tr -dc '0-9')))"
[ -n "$1" ] && VOL="$((VOL - VOL % $1))"
case "${1:0:1}" in