Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AmNotAGoose opened this issue Apr 29, 2024 · 2 comments

Comments

@AmNotAGoose
Copy link

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
Copy link
Member

x70b1 commented Apr 30, 2024

Which shell are you using?

@AmNotAGoose
Copy link
Author

I'm using bash

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants