Systemd/logind: Difference between revisions

imported>Profpatsch
create logind page, power button and inhibits.
 
imported>SidharthArya
m Visibility of Quote marks
Line 12: Line 12:
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:
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:


   services.logind.extraConfig = ''
   <nowiki>services.logind.extraConfig = ''
     # don’t shutdown when power button is short-pressed
     # don’t shutdown when power button is short-pressed
     HandlePowerKey=ignore
     HandlePowerKey=ignore
   '';
   '';</nowiki>


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.
Line 29: Line 29:
<code>logind</code> logind still overrides that user decision. For it to work, you need to tell logind to ignore the lid switch in your system config:
<code>logind</code> logind still overrides that user decision. For it to work, you need to tell logind to ignore the lid switch in your system config:


   services.logind.extraConfig = ''
   <nowiki>services.logind.extraConfig = ''
     # want to be able to listen to music while laptop closed
     # want to be able to listen to music while laptop closed
     LidSwitchIgnoreInhibited=no
     LidSwitchIgnoreInhibited=no
   '';
   '';</nowiki>