Systemd/logind: Difference between revisions
No edit summary |
Use dedicated config options instead of extraConfig for services.logind |
||
| Line 20: | Line 20: | ||
<translate> | <translate> | ||
<!--T:6--> | <!--T:6--> | ||
On a laptop, you often don’t want an accidental short press of the power button to shut down your system, but instead to <code>suspend</code> or <code>hibernate</code>. You can add the following snippet to your <code>logind</code> config: | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T:7--> | <!--T:7--> | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
services.logind. | services.logind.powerKey = "suspend"; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T:8--> | <!--T:8--> | ||
If you want to ignore short presses of the power button entirely, you can use the following snippet instead: | |||
<syntaxhighlight lang="nix"> | |||
services.logind.powerKey = "ignore"; | |||
</syntaxhighlight> | |||
Long-pressing your power button (5 seconds or longer) to do a hard reset is handled by your machine’s BIOS/EFI and thus still possible. | Long-pressing your power button (5 seconds or longer) to do a hard reset is handled by your machine’s BIOS/EFI and thus still possible. | ||
</translate> | </translate> | ||