polybar-scripts icon indicating copy to clipboard operation
polybar-scripts copied to clipboard

battery-combined-udev 34: arithmetic expression: expecting primary: ""31800000 + 0""

Open AmNotAGoose opened this issue 9 months ago • 3 comments

When I try to use battery-combined-udev it gives me this error: 34: arithmetic expression: expecting primary: ""31800000 + 0""

A similar error happens the following lines:

    battery_level=$(("$battery_level_0 + $battery_level_1"))
    battery_max=$(("$battery_max_0 + $battery_max_1"))

    battery_percent=$(("$battery_level * 100"))
    battery_percent=$(("$battery_percent / $battery_max"))

After changing it to the following, the problem was fixed

    battery_level=$(($battery_level_0 + $battery_level_1))
    battery_max=$(($battery_max_0 + $battery_max_1))

    battery_percent=$(($battery_level * 100))
    battery_percent=$(($battery_percent / $battery_max))

AmNotAGoose avatar Apr 29 '24 23:04 AmNotAGoose

Which shell are you using?

x70b1 avatar Apr 30 '24 09:04 x70b1

I'm using bash

ps -p $$
    PID TTY          TIME CMD
  86772 pts/0    00:00:00 bash

AmNotAGoose avatar May 03 '24 18:05 AmNotAGoose

Same here, using bash in Debian Bookworm.

agis avatar Jul 14 '24 19:07 agis