feat: cleaner light/vol rounds

This commit is contained in:
ange 2024-05-18 22:15:56 +02:00
parent 202436aafa
commit 7b202de6cc
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
5 changed files with 8 additions and 17 deletions

View file

@ -5,7 +5,7 @@ NOTIFY=(notify-send -t 1000 -a "$(basename "$0")" -u low)
function update_vol() {
if [[ "$1" =~ ^(-|\+)* ]]; then
CUR="$((CUR - CUR % $1 + $1))"
CUR="$(($CUR + $1 - $CUR % $1 + $CUR % $1 * 10 / $1 / 5 * $1))"
[ "$CUR" -lt 0 ] && CUR=0
[ "$CUR" -gt 150 ] && CUR=150
else