Fix sb-volume decimal integer misinterpreting

Shell script interprets zero-prefixed decimal integer as octal integer so it throws an error when "vol" is equal to "08" or  "09" because this values are invalid octal numbers. Now "vol" forced to be decimal.
This commit is contained in:
EvgenHi 2023-04-16 21:03:26 +03:00 committed by GitHub
parent d4ff2ebaf3
commit 9ed86e9eb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,9 +30,9 @@ split() {
vol="$(printf "%.0f" "$(split "$vol" ".")")"
case 1 in
$((vol >= 70)) ) icon="🔊" ;;
$((vol >= 30)) ) icon="🔉" ;;
$((vol >= 1)) ) icon="🔈" ;;
$((10#$vol >= 70)) ) icon="🔊" ;;
$((10#$vol >= 30)) ) icon="🔉" ;;
$((10#$vol >= 1)) ) icon="🔈" ;;
* ) echo 🔇 && exit ;;
esac