feat: Add battery status of peripheral devices to waybar #3377
+230
−2
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.
I find it quite helpful to know the battery state of my connected peripherals.
This PR adds such an indicator to the very right of the waybar.
It uses upower under the hood and scans every 30 seconds for changes.
It adds this peripherals icon and on tooltip you get the status of the individual devices

The top-level icon on the waybar itself is white, if all devices are in the good state, gets yellow, if one or many of the devices are below the good threshold and red, if one or many of the devices are in critical state.
This should give a nice early warning, to charge the battery.
The migration itself should update the waybar config without overwriting custom configurations. While this is quite more complex than simply refreshing with the default waybar config, I think especially the waybar configuration might be customized quite frequently, so we might try to be careful here.