Power Management: Difference between revisions
m style fixes |
|||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 48: | Line 48: | ||
Therefore, an example configuration could look like this:<syntaxhighlight lang="nix"> | Therefore, an example configuration could look like this:<syntaxhighlight lang="nix"> | ||
# I'm hibernating into a logical volume that's also under LUKS. Pretty cool, right? | |||
swapDevices = [ | swapDevices = [ | ||
| Line 61: | Line 61: | ||
/dev/zram0 partition 32881148 032767</syntaxhighlight> | /dev/zram0 partition 32881148 032767</syntaxhighlight> | ||
Test and use hibernation with the following command:<syntaxhighlight lang=" | Test and use hibernation with the following command:<syntaxhighlight lang="console"> | ||
systemctl hibernate | $ systemctl hibernate | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Tips and tricks == | == Tips and tricks == | ||
=== | === Hibernate after specified time === | ||
Using following configuration, your system will go from suspend into hibernate after 1 hour:<syntaxhighlight lang="nix"> | Using following configuration, your system will go from suspend into hibernate after 1 hour:<syntaxhighlight lang="nix"> | ||
systemd.sleep. | systemd.sleep.settings.Sleep = { | ||
HibernateDelaySec=1h | HibernateDelaySec = "1h"; | ||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Disable all sleep functionality === | |||
Some desktop environment and display manager combinations might attempt to put your machine to sleep as default behavior (i.e. SDDM and KDE Plasma 6 under Wayland). If this is not what you want, you can define the following to block any service attempting to put your machine to sleep via systemd: | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
systemd.sleep. | systemd.sleep.settings.Sleep = { | ||
AllowHibernation = "no"; | |||
AllowHybridSleep = "no"; | |||
AllowSuspend = "no"; | |||
AllowSuspendThenHibernate=no | AllowSuspendThenHibernate = "no"; | ||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 130: | Line 133: | ||
You can temporarily toggle a device by writing its "Device" name back into <code>/proc/acpi/wakeup</code> | You can temporarily toggle a device by writing its "Device" name back into <code>/proc/acpi/wakeup</code> | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="console"> | ||
echo GPP0 | sudo tee /proc/acpi/wakeup | $ echo GPP0 | sudo tee /proc/acpi/wakeup | ||
</syntaxhighlight> | </syntaxhighlight> | ||