swaywm/swayidle

[Feature Request] Charge state / power aware timeouts

kittydoor opened this issue · 0 comments

I would like to configure swayidle to have separate timeouts depending on whether my device is running on battery power or is charging/doesn't have a battery.

This would let me have a long suspend time (like 2 hours) for my desktop or laptops currently charging and mounted to a display, while letting devices running on battery suspend quickly (like 30 minutes) to not waste their charge.

One edge case to consider is, if a device was on charge and the early/battery timeout has expired and was ignored, but then power cuts out. In my opinion, in this case, the device should immediately suspend.

This is of course possible to implement on top of swayidle, but would require keeping state externally.