Battery status wrong when Bluetooth device is used

When a Bluetooth device with a battery status is present, the phone shows the wrong battery status.

This is caused by the fact that a bluetooth device (keyboard for example) will also create a *-battery entry in /sys/class/power_supply/ and the sxmo_statusbar.sh script uses a PCT="$(cat /sys/class/power_supply/*-battery/capacity)". This causes cat to append all the battery outputs, causing the ifs to fail fail (always displaying full battery) (same problem with the charging status).

Reproduce: Connect a bluetooth keyboard and look at the statusbar.

Temporary fix: Set the paths directly (without the * wildcard)

I have no fix-solution, as I do not know if the battery name on the pinephone can change.

Assigned to
a month ago
a month ago
No labels applied.

~anjan REPORTED DUPLICATE a month ago

See: #243

This bug should be fixed with the solution written in the comments. Closing since this is a duplicate.

Register here or Log in to comment, or comment via email.