From 9ed86e9eb5b1cb0c2b594430e3dabab865c4a5c2 Mon Sep 17 00:00:00 2001 From: EvgenHi <91457298+EvgenHi@users.noreply.github.com> Date: Sun, 16 Apr 2023 21:03:26 +0300 Subject: [PATCH] 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. --- .local/bin/statusbar/sb-volume | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index acdf7a9e..65d1bf1b 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -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