Systemd/logind: Difference between revisions

Unabomberlive (talk | contribs)
No edit summary
Lukec (talk | contribs)
Use dedicated config options instead of extraConfig for services.logind
Line 20: Line 20:
<translate>
<translate>
<!--T:6-->
<!--T:6-->
When you use a laptop, often you don’t want an accidental short press of the power button to shut down your system. You can add the following snippet to your <code>logind</code> config:
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.extraConfig = ''
services.logind.powerKey = "suspend";
    # don’t shutdown when power button is short-pressed
    HandlePowerKey=ignore
  '';
</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>