Laptop: Difference between revisions

Klinger (talk | contribs)
- reordered headings (moved all headings one heading up). Added the 3 options for closing the lid.
Phobos (talk | contribs)
Corrected config
Line 1: Line 1:
= Closing the lid =
= Closing the lid =
<syntaxhighlight lang="nixos">
{{File|3=services.logind.settings.Login = {
services.logind.lidSwitch = "poweroff";
  HandleLidSwitch = "poweroff";
services.logind.lidSwitchExternalPower = "lock";
  HandleLidSwitchExternalPower = "lock";
services.logind.lidSwitchDocked = "ignore";
  HandleLidSwitchDocked = "ignore";
};


# one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", "lock"
# one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", "lock"|name=/etc/nixos/configuration.nix|lang=nix}}
</syntaxhighlight>These three options can be used to configure how a laptop should behave when the lid is closed. In this example, it normally shuts down. If power is connected, only the screen is locked. If another screen is connected instead, nothing happens.
These three options can be used to configure how a laptop should behave when the lid is closed. In this example, it normally shuts down. If power is connected, only the screen is locked. If another screen is connected instead, nothing happens.


= Power management =
= Power management =