lxde / lxpanel

Other
52 stars 38 forks source link

battery monitor refresh and warning #42

Open cburgard opened 2 years ago

cburgard commented 2 years ago

I'm using a Lenovo T14s, running archlinux with LXDE. lxpanel does an awesome job, thank you very much for this excellent piece of software! My only complaint right now is that the battery monitor behaves weirdly, namely: Whenever the power is plugged or unplugged, I get a "Battery low" warning for a few moments, regardless of how full the battery is currently. This is a bit annoying, especially when you're on an irregular power supply (like, e.g., power outlets in public transport), because you'll get warnings every few seconds. This is dangerous because you'll start ignoring these warnings and miss them when they're actually important - this has happened to me before. Looking through the code, I was trying to figure out whether there's a way to avoid this happening. I don't really know how this works exactly, but as far as I can see, the battery monitor just reads out whatever is in the ACPI provided files, which is fair. I suppose the real issue is with acpi and/or the hardware not providing correct numbers in the moment of plugging in or out, and I'm not sure how much can be done about that. One "workaround" however would be to reduce the frequency at which the battery monitor checks the input, so that short fluctuations are not picked up - and let's be real: we don't need battery updates more than every minute or so. So please take this as a feature request to add an option to manually set / override the frequency at which the monitor updates itself - or, alternatively, to add a "grace period" to the battery notification such that the warning is only displayed if the battery is below threshold for a certain number of time (5 seconds or so), to suppress "fake" notifications due to momentary fluctuations.