My system powered off without any warning, so I've implemented the expected warnings and sound alerts here.
Plays sound when entering a low battery threshold (<20%)
Plays critical sound alert repeatedly when entering the critical battery threshold (<10%)
Unless or until the system's AC adapter is plugged in
Plays sound when plugged and unplugged
If battery is critical, a critical sound alert begins
Unplugging while critical plays power-unplug-battery-low from the Pop sound theme (if the Pop sound theme is installed)
Displays notifications for critical and low battery alerts
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.
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