Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
How to add "suspend-then-hibernate" in GNOME
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: How to add "suspend-then-hibernate" in GNOME
Thanks. All the options discussed therein are the same as those that can be achieved through dconf-editor (org.gnome.settings-daemon.plugins.power). However, in both cases there are only three available options: suspend, hibernate, and do-nothing. I am interested in bringing the computer to hibernate mode after having suspended for a preset amount of time.
As I mentioned in the beginning, I think the problem (for lacking the "suspend-then-hibernate" power option) is caused by gnome overriding the systemd instruction. Is there any way to add the "suspend-then-hibernate" power option plugin for gnome? Is there such a plugin?
-
- Posts: 932
- Joined: 2020-05-03 14:16
- Has thanked: 7 times
- Been thanked: 68 times
Re: How to add "suspend-then-hibernate" in GNOME
FYI, There's no such option - the systemd option "AllowSuspendThenHibernate" name is incorrect -> It's physically impossible to perform a "suspend-then-hibernate" operation. However it's possible to perform hiberanate-then-suspend.
Suspended system simply can't perform any actions, i.e. it can't perform hibernation in suspended state.
"hiberanate-then-suspend" works by first saving the RAM data to a swap and then suspending to RAM. When the battery gets fully discharged, then the data in RAM are lost, but the system can recover its previous state from swap.
I'm not using GNOME (and it will never happen) - so I can't help with "plugins"
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
The_full_story and Nothing_have_changed
Re: How to add "suspend-then-hibernate" in GNOME
Systemd sleep.conf file provides the following sleep options:
To enable the suspend-then-hibernate option, the following two lines need to be uncommented:
The above configuration, if executed, will cause the system to wake up and go into hibernate mode (and, of course, turn off the computer) after suspending for, as the above example indicates, 180 minutes.
However gnome has its own sleep configuration, rendering the systemd's sleep.conf file moot.
BTW, once the system goes into the hibernation mode, power will be turned off; It's physically impossible, thereafter, to perform a "suspend-then-hibernate", or any other operation. (This is different from the hybrid suspend-and-hibernate combo.)
Code: Select all
[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendMode=
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateState=disk
#HybridSleepMode=suspend platform shutdown
#HybridSleepState=disk
#HibernateDelaySec=180min
Code: Select all
AllowSuspendThenHibernate=yes
HibernateDelaySec=180min
However gnome has its own sleep configuration, rendering the systemd's sleep.conf file moot.
BTW, once the system goes into the hibernation mode, power will be turned off; It's physically impossible, thereafter, to perform a "suspend-then-hibernate", or any other operation. (This is different from the hybrid suspend-and-hibernate combo.)
Re: How to add "suspend-then-hibernate" in GNOME
One (stupid) workaround is to use different actions to trigger suspend and hibernation, respectively.
If I want "suspend", I'm using gnome tweaks to set lid-close to suspend. Thus, each time I want to suspend the computer I simply close the lid. For desktops I can use gnome system panel to click on suspend.
Then I use the dconf-editor to set sleep option to "hibernate after 10 minutes inaction". Recently we purchased a Zen3 based ASUS laptop, boot time is less than 10 seconds. This is actually faster than the suspend wake-up time for some of the older computers we have.
If I want "suspend", I'm using gnome tweaks to set lid-close to suspend. Thus, each time I want to suspend the computer I simply close the lid. For desktops I can use gnome system panel to click on suspend.
Then I use the dconf-editor to set sleep option to "hibernate after 10 minutes inaction". Recently we purchased a Zen3 based ASUS laptop, boot time is less than 10 seconds. This is actually faster than the suspend wake-up time for some of the older computers we have.
-
- Debian Developer
- Posts: 442
- Joined: 2022-07-12 14:10
- Has thanked: 1 time
- Been thanked: 87 times
Re: How to add "suspend-then-hibernate" in GNOME
I believe systemd suspends, then wakes up using an alarm and then performs hibernate. It also takes care to observe the battery capacity so that the system never fully discharges the battery. Please check the source code at https://github.com/systemd/systemd/blob ... eep.c#L265LE_746F6D617A7A69 wrote: ↑2022-08-04 21:24 FYI, There's no such option - the systemd option "AllowSuspendThenHibernate" name is incorrect -> It's physically impossible to perform a "suspend-then-hibernate" operation. However it's possible to perform hiberanate-then-suspend.
Suspended system simply can't perform any actions, i.e. it can't perform hibernation in suspended state.
"hiberanate-then-suspend" works by first saving the RAM data to a swap and then suspending to RAM. When the battery gets fully discharged, then the data in RAM are lost, but the system can recover its previous state from swap.
You can also check man systemd-sleep.conf:
Code: Select all
A low power state where the system is initially suspended (the state is stored in RAM). If not interrupted within the delay specified by HibernateDelaySec=, the system will be woken using an RTC alarm and hibernated (the state is then stored on disk).
I think it's not very constructive to post to GNOME questions and state that you will never use GNOME...LE_746F6D617A7A69 wrote: ↑2022-08-04 21:24 I'm not using GNOME (and it will never happen) - so I can't help with "plugins"
Re: How to add "suspend-then-hibernate" in GNOME
Gnome control center (now "Gnome Settings") also overrides configurations from dconf. In dconf, I set the power button to hibernate. However, since gnome settings does not have hibernate option, this instruction was ignored.
Re: How to add "suspend-then-hibernate" in GNOME
Forgot to mention that, at least at the present time, hibernation requires that the safe boot be turned off.
Also, although the dconf "setting the power button to hibernate" option is bypassed by gnome settings, I can set a hotkey (e.g. "ctlr + alt + h") to execute the "systemctl hibernate" command similar to the "power button to hibernate" action; this command does not need root privilege to execute (at least in Debian 12).
Also, although the dconf "setting the power button to hibernate" option is bypassed by gnome settings, I can set a hotkey (e.g. "ctlr + alt + h") to execute the "systemctl hibernate" command similar to the "power button to hibernate" action; this command does not need root privilege to execute (at least in Debian 12).