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

Ability to blacklist battery percentage sources in battery block #108

Open
sandler31 opened this issue Sep 3, 2017 · 1 comment
Open

Comments

@sandler31
Copy link

sandler31 commented Sep 3, 2017

Battery block is missing the ability to blacklist battery percentage sources in battery block.

I say this because of problem I recently encountered:
I got a new Dell keyboard/mouse, which is actually manufactured by Logitech, and implements some kind of HID device that that should report the battery status of both keyboard and mouse.
Apart from the fact that those values are not related to the laptop battery, and they are thrown into the overall calculation, they don't really seem to work on my keyboard/mouse and are reporting zero values.
This causes of course, a weird battery level on my i3-bar.

lsusb for reference:

Bus 003 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver

Values that acpi reports:

Battery 0: Discharging, 0%, rate information unavailable
Battery 1: Full, 100%
Battery 2: Discharging, 0%, rate information unavailable

ls /sys/class/power_supply

AC  BAT0  hidpp_battery_4  hidpp_battery_5

upower -e

/org/freedesktop/UPower/devices/line_power_AC
/org/freedesktop/UPower/devices/battery_BAT0
/org/freedesktop/UPower/devices/unknown_0003o046Do4048x0014
/org/freedesktop/UPower/devices/unknown_0003o046Do4049x0015
/org/freedesktop/UPower/devices/DisplayDevice

I'd try to implement such a feature myself, but it seems this will require a change in the way the battery block queries the battery percentage currently, and I'm not sure which way this should go, thus I'd like to open this up for conversation.

@kb100
Copy link
Collaborator

kb100 commented Sep 4, 2017

Change the line in the script that says

if battery!='':

to

if battery.startswith("Battery 1:"):

does this fix the issue for you?

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