Better battery-monitor and notifier #3991
brutalsam96
started this conversation in
Ideas
Replies: 1 comment
-
|
Few weeks of testing on my local system, deleted bash script battery monitor and functionality has been good so far with no issues, did not profile for overhead but theoretically it should be near-zero since dbus library is async and other features i described that make this solution superior, so if you guys @dhh @ryanrhughes can review this, i can work on implementation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
Recently I’ve been obsessed with tinkering with the battery monitor and notifications on Omarchy. I previously added some UX features to the current omarchy-battery-monitor script in PR #3832 , but I felt like it wasn't enough.
I dove deeper into UPower DBus and discovered that the upower.device interface emits the PropertiesChanged signal. By using an app that listens for this specific signal, we can react to power changes instantly. This method is vastly superior to a script that polls every 30 seconds with a timer.
What I’ve built:
Python battery-monitor app: I recently finished this, along with a small wrapper for the dbus-next library.
Lightweight & Async: Using dbus-next is a big improvement over the older dbus library because it allows for pure asynchronous operations without needing a heavy Glib dependency.
Customizable:: I have made it slightly customizable, with use of command line arguments we can customize thresholds and disable notificiations when charger is plugged in(which is not an existing feature in current bash script)
Event-Driven: The app stays idle and listens for PropertiesChanged. When battery thresholds are reached, it sends a notification to the system daemon immediately.
The Proposal: I propose that we switch to this Python app for our battery monitoring and notifications. I am currently testing it on my own system with the original bash script uninstalled, and it’s working great.
If the maintainers approve, I can work on a migration script and submit a Pull Request to implement this app.
Beta Was this translation helpful? Give feedback.
All reactions