Power Management: Difference between revisions
Update section formatting and replace deprecated sleep option |
m style fixes |
||
| (One intermediate revision by one other user 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> | ||
| Line 69: | Line 69: | ||
=== Hibernate after specified time === | === 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> | ||
| Line 133: | 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> | ||