Systemd/logind: Difference between revisions

Ardenet (talk | contribs)
reposition translate tag to reduce translation chage
Tags: Mobile edit Mobile web edit Visual edit
DHCP (talk | contribs)
m remove unneeded blank line
 
(6 intermediate revisions by 3 users not shown)
Line 3: Line 3:
<!--T:1-->
<!--T:1-->
<code>logind</code> is systemd’s login manager.
<code>logind</code> is systemd’s login manager.
</translate>
 
<translate>
<!--T:2-->
<!--T:2-->
Its main manual page is <code>systemd-logind.service(8)</code>. Its configuration options are described in <code>logind.conf(5)</code>.
Its main manual page is <code>systemd-logind.service(8)</code>. Its configuration options are described in <code>logind.conf(5)</code>.
</translate>
 
<translate>
== Handling of power keys == <!--T:3-->
== Handling of power keys == <!--T:3-->


Line 21: Line 19:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.logind.powerKey = "suspend";
services.logind.settings.Login.HandlePowerKey = "suspend";
</syntaxhighlight>
</syntaxhighlight>


<translate>
<translate>
<!--T:8-->
<!--T:14-->
If you want to ignore short presses of the power button entirely, you can use the following snippet instead:
If you want to ignore short presses of the power button entirely, you can use the following snippet instead:
</translate>
</translate>


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.logind.powerKey = "ignore";
services.logind.settings.Login.HandlePowerKey = "ignore";
</syntaxhighlight>
</syntaxhighlight>


<translate>
<translate>
<!--T:8-->
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.


<!--T:15-->
Similar to the power key, you can ignore the reboot, suspend and hibernate keys like this:
Similar to the power key, you can ignore the reboot, suspend and hibernate keys like this:
</translate>
</translate>


<syntaxhighlight lang="nixos">
<syntaxhighlight lang="nixos">
services.logind.rebootKey = "ignore";
services.logind.settings.Login.HandleRebootKey = "ignore";
services.logind.suspendKey = "ignore";
services.logind.settings.Login.HandleSuspendKey = "ignore";
services.logind.hibernateKey = "ignore";
services.logind.settings.Login.HandleHibernateKey = "ignore";
</syntaxhighlight>
</syntaxhighlight>


<translate>
<translate>
<!--T:16-->
Or ignore the action of closing/opening the lid on laptops like this:
Or ignore the action of closing/opening the lid on laptops like this:
</translate>
</translate>


<syntaxhighlight lang="nixos">
<syntaxhighlight lang="nixos">
services.logind.lidSwitch = "ignore";
services.logind.settings.Login.HandleLidSwitch = "ignore";
</syntaxhighlight>
</syntaxhighlight>
<translate>


<translate>
=== Ignore hardware keys when using <code>systemd-inhibit</code> === <!--T:9-->
=== Ignore hardware keys when using <code>systemd-inhibit</code> === <!--T:9-->


Line 62: Line 63:
Say you want your laptop to stay awake when closing the lid in some circumstances, for example if you want to listen to music. If you start your lock screen with an inhibit on the lid switch
Say you want your laptop to stay awake when closing the lid in some circumstances, for example if you want to listen to music. If you start your lock screen with an inhibit on the lid switch


<!--T:17-->
<code>systemd-inhibit --what=handle-lid-switch lock-screen-tool</code>
<code>systemd-inhibit --what=handle-lid-switch lock-screen-tool</code>


Line 69: Line 71:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.logind.extraConfig = ''
services.logind.settings.Login = {
   # want to be able to listen to music while laptop closed
   # If you want to listen to music while the lid is closed
   LidSwitchIgnoreInhibited=no
   HandleLidSwitch = "ignore";
'';
};
</syntaxhighlight>
</syntaxhighlight>


<translate>
<translate>
<!--T:18-->
[[Category:Applications]]
[[Category:Applications]]
[[Category:systemd]]
[[Category:systemd]]
</translate>
</translate>