Skip to content

Conversation

@sweenu
Copy link
Contributor

@sweenu sweenu commented Nov 15, 2025

Right now, the battery level alert toasts were firing at each percent down and it would trigger all the matching alerts instead of the lowest one.

With these changes:

  • only the lowest level ever trigger
  • we only trigger the toast when crossing the threshold and not at every percent down
  • on shell startup and on unplugging, it checks if we are already under a threshold and fires an alert for that threshold

Fixes #736

@nuknes
Copy link
Contributor

nuknes commented Nov 15, 2025

edit:
actually you're right, I allowed the battery on my notebook to deplete and am now seeing toast spam on every percentage drop right now

the code attempts to store the mutable warned state on read only objects loaded from the JSON config, causing the condition !level.warned to evaluate to true every time the percentage changes

@sweenu
Copy link
Contributor Author

sweenu commented Nov 15, 2025

@nuknes Okay, that makes more sense, I couldn't understand what would make it work for some people.

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.

[BUG] Low battery toast pops on every percent down

2 participants