This repository was archived by the owner on Jul 24, 2026. It is now read-only.
feat: notify when battery drops below configurable threshold - #17
Merged
Conversation
The low battery point was hardcoded at 20 percent. What counts as low really depends on the mouse and on personal taste, so let users pick the threshold themselves in the widget settings.
A dying mouse is easy to miss until it stops working. Warning once when the level drops below the configured threshold leaves enough time to put it on the charger. The warning is latched so a sleeping or reconnecting mouse does not nag again, and the state found at startup stays silent so a shell reload does not repeat old warnings.
A single bar made it hard to tell how close the battery is to the low battery warning point. Splitting the bar at the threshold makes that visible at a glance. The bar is also hidden when no supported mouse is present, since showing a level without a device would be misleading.
The settings page was a flat list under one big title. Splitting it into labeled sections makes it easier to scan as options grow. The new GitHub link gives users a quick way to reach the project page. It pulls the homepage from plugin.json so the URL only lives in one place.
Notifications only worked while the widget was placed in the bar. Readings that jitter around the threshold or briefly touch a charger could announce over and over, and there was no setting to turn the announcements off. Default values were also repeated across files, so they could drift apart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notify when the mouse battery level drops to or below a configurable threshold. Closes #2.