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 module no longer instantly updates #2519

Open
7ff04da4aa6ac37197e249299066ac30 opened this issue Sep 19, 2023 · 6 comments · May be fixed by #3474
Open

Battery module no longer instantly updates #2519

7ff04da4aa6ac37197e249299066ac30 opened this issue Sep 19, 2023 · 6 comments · May be fixed by #3474
Labels
bug Something isn't working help wanted Extra attention is needed regression

Comments

@7ff04da4aa6ac37197e249299066ac30

Back in version 0.9.17 (I think), the battery module would instantly update whenever I plugged or unplugged the charger on my notebook (I have it set up so that the background color for the module changes on toggling charging). However, through no fault of my own (I assume, since I didn't touch my configuration), this is no longer the case: the module now seems to update at the default interval of 60 seconds.

How do I revert this? Or, at least, change my config so that it goes back to how it was, toggling instantly on plugging/unplugging the charger without setting the interval to something like a few seconds (I don't want constant polling).

@aspizu
Copy link

aspizu commented Sep 21, 2023

Can recreate on Arch Linux. Waybar v0.9.22

@hcur
Copy link

hcur commented Sep 29, 2023

I'm not affiliated with this project but I wrote a bit about what worked for me here: #2444

@Lassebq
Copy link

Lassebq commented Sep 29, 2023

It used to update instantly!?

@monomycelium
Copy link

I've been facing the same issue as well… Is there a way to subscribe to changes in the battery state?

@timblaktu
Copy link

Same here on:

Waybar v0.9.22-82-g4c0347d9 (branch 'master')
OS: Arch Linux x86_64
Host: 21DCCTO1WW ThinkPad P1 Gen 5
Kernel: 6.5.5-arch1-
Shell: zsh 5.9
Resolution: 3840x2160
DE: Hyprland
WM: sway
CPU: 12th Gen Intel i7-12700H (20) @ 4.600GHz
GPU: NVIDIA RTX A1000 Laptop GPU
Memory: 21135MiB / 64082MiB

In my case, the unplugged event is still handled by waybar within 2-3 sec, but the plugged event is never handled. I have no interval set in my battery config, BTW, of course setting this works around the issue by forcing polling.

I worked around it without polling by reloading waybar from my acpi event handler script, which I have handling button presses on my Thinkpad p1g5 laptop..

@Alexays Alexays added bug Something isn't working help wanted Extra attention is needed regression labels Oct 17, 2023
@kira-bruneau
Copy link

I noticed the same thing, but I don't think the regression was introduced in sway. I'm still seeing it in 0.9.17.

The battery module uses inotify to watch for accesses to the power supply's uevent file:

auto wd = inotify_add_watch(battery_watch_fd_, event_path.c_str(), IN_ACCESS);

but it should be using netlink to listen to changes: https://unix.stackexchange.com/questions/579460/why-doesnt-inotifywait-report-modifications-made-to-battery-capacity-file.

I have a feeling that this used to work because something would trigger an IN_ACCESS event, but doesn't anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants