This only happens when pulseaudio starts running (sometimes). It does go away, but it still should be fixed. At this line:
# Fixed volume icons over max volume
local iconsLen=${#VOLUME_ICONS[@]}
if [ "$iconsLen" -ne 0 ]; then
local volSplit=$((MAX_VOL / iconsLen))
for i in $(seq 1 "$iconsLen"); do
if [ $((i * volSplit)) -ge $curVol ]; then # <-- Here
volIcon="${VOLUME_ICONS[$((i-1))]}"
break
fi
done
else
volIcon=""
fi
It happens in the ouput function, which does check if pulseaudio is running, but as it's still loading some obtained variable is probably incorrect (curVol?). The bug should be fixed by checking for errors when getCurSink, getCurVol and getCurMuteStatus are called. This could also implement a better solution to check if pulseaudio is running, rather than this:
if [ -z "$(pgrep pulseaudio)" ]; then echo "Pulseaudio not running"; return 1; fi
The design choice here is whether the return value of these functions should be checked, or maybe they handle the errors by themselves and exit the script.
This only happens when pulseaudio starts running (sometimes). It does go away, but it still should be fixed. At this line:
It happens in the
ouput
function, which does check if pulseaudio is running, but as it's still loading some obtained variable is probably incorrect (curVol
?). The bug should be fixed by checking for errors whengetCurSink
,getCurVol
andgetCurMuteStatus
are called. This could also implement a better solution to check if pulseaudio is running, rather than this:The design choice here is whether the return value of these functions should be checked, or maybe they handle the errors by themselves and exit the script.