polybar / polybar-scripts

This is a community project. We write and collect scripts for polybar!
The Unlicense
2.48k stars 340 forks source link

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

Open AmNotAGoose opened 6 months ago

AmNotAGoose commented 6 months ago

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))
x70b1 commented 6 months ago

Which shell are you using?

AmNotAGoose commented 5 months ago

I'm using bash

ps -p $$
    PID TTY          TIME CMD
  86772 pts/0    00:00:00 bash
agis commented 3 months ago

Same here, using bash in Debian Bookworm.