Skip to content

Conversation

@versenilvis
Copy link

@versenilvis versenilvis commented Jan 22, 2026

Preview

image This is my personal style, you can change it image image image image

Why?

  • We use bluetooth devices like keyboard, mouse, airpod, ...
  • It would be very bad user experience if our device run out of battery without notification
  • So I see that ambxst shows bluetooth devices' battery, I made a simple noti sender when it drops to 15% and 5%

What changed?

Note

  • Battery low notification - only send once per threshold crossing
  • Only notify at 5% if not already notified and battery is 5% or below
  • Only notify at 15% if not already notified and battery is between 6-15%
  • Reset flags when battery goes back up
  • Some devices might keep polling, I had handled to send only one time, the notification won't keep pop-up
image
  • It's not only send when it drops to 15% and 5%
  • I added flag notified15 and notified5 when you haven't get any notification about your bluetooth device battery
  • Imagine this, you open your PC, but your bluetooth keyboard is now at 4%, if we don't send notification at this time, it will shutdown anyway and we don't even notice this, you don't want to find the charger while enjoying the thing you do
  • After changing above 5% and 15%, these two will be reset

Important

  • Not all devices have battery info sending feature
  • Look below, it's showing my mouse is at 100%, but no, it's not
  • Depends on the hardware, some don't come up with this feature
image

- Battery low notification - only send once per threshold crossing
- Only notify at 5% if not already notified and battery is 5% or below
- Only notify at 15% if not already notified and battery is between
6-15%
- Reset flags when battery goes back up
- Some devices might keep polling, if we don't add this, the
notification will keep pop-up
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

Successfully merging this pull request may close these issues.

1 participant