diff --git a/TODO b/TODO index 8d0a4dabcf..159d540cea 100644 --- a/TODO +++ b/TODO @@ -19,6 +19,21 @@ Janitorial Clean-ups: Features: +* beef up s2h to implement a battery watch loop: instead of entering + hibernation unconditionally after coming back from resume make a decision + based on the battery load level: if battery level is above a specific + threshold, go to suspend again, only hibernate if below it. This means we'd + stick to suspend usually, but fall back to hibernation only when battery runs + empty (well, subject to our sampling interval). Related to this, check if we + can make ACPI _BTP (i.e. /sys/class/power_supply/*/alarm) work for us too, + i.e. see if it can wake up machines from suspend, so that we could resume + automatically when the system is low on power and move automatically to + hibernation mode. (see + https://uefi.org/sites/default/files/resources/ACPI%206_2_A_Sept29.pdf + section 10.2.2.8 and + https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-wake-sources + at the end). + * add an explicit "vertical" mode to format-table, so that "systemctl status"-like outputs (i.e. with a series of field names left and values right) become genuine first class citizens, and we gain automatic, sane JSON diff --git a/man/systemd-sleep.conf.xml b/man/systemd-sleep.conf.xml index 3311a046ca..a6949b0c3b 100644 --- a/man/systemd-sleep.conf.xml +++ b/man/systemd-sleep.conf.xml @@ -168,11 +168,10 @@ HibernateDelaySec= - The amount of time in seconds - that will pass before the system is automatically - put into hibernate when using - systemd-suspend-then-hibernate.service8. - + The amount of time the system spends in suspend mode before the system is + automatically put into hibernate mode, when using + systemd-suspend-then-hibernate.service8. Defaults + to 2h. diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c index f3c54f5ca1..26ed4776b9 100644 --- a/src/shared/sleep-config.c +++ b/src/shared/sleep-config.c @@ -82,7 +82,7 @@ int parse_sleep_config(SleepConfig **ret_sleep_config) { if (!sc->hybrid_states) sc->hybrid_states = strv_new("disk"); if (sc->hibernate_delay_sec == 0) - sc->hibernate_delay_sec = 180 * USEC_PER_MINUTE; + sc->hibernate_delay_sec = 2 * USEC_PER_HOUR; /* ensure values set for all required fields */ if (!sc->suspend_states || !sc->hibernate_modes