Waybar
Waybar copied to clipboard
Make battery module update on plugging/unplugging again (refs #2519)
When switching how you listen for battery plugging status events, the battery status will instantly update again! Instead of inotify events on the /sys/class/.../ files, it is recommended to listen to udev netlink kernel events.
Closes #2444 Closes #2519
I will aid implementing this, because I'm new to this project. I will try to make this code look more like the backlight_backend, which also uses the udev netlink interfaces.
So it seems, that the udev kernel events are sent very early. The battery status "Charging" might return just a bit later from the /sys/class/powersupply/BAT0/status path, than the last event is received.
For my setup, this will result in a "Plugged in" (but not charging) state :(
When implementing some sleep(1) this race condition does not occur anymore, but this cannot be a solution.
Might also Closes #3726 Closes #3603 Closes #3471
Hi, this looks awesome. @Alexays would you consider accepting this PR?
LGTM.
Reverted, FreeBSD is failing.