feat: notifications and sound alerts on AC hotplug and low battery #17
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.
My system powered off without any warning, so I've implemented the expected warnings and sound alerts here.
power-unplug-battery-low
from the Pop sound theme (if the Pop sound theme is installed)We should also think about automatically shutting down when the battery reaches a certain threshold to get ahead of any potential file system corruption or data loss.
I've noticed that zbus is behaving very unreliably with AC hotplug events in upower. Messages are received very sluggishly, and often dropped altogether. Seems to also happen in the example of our upower-dbus crate. Listening to
/var/run/acpid.socket
for AC adapter plug events was more reliable.Partially improves #18