[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandleSuspendKey=suspend
HandlePowerKey=lock
#HandlePowerKey=poweroff
#HandleHibernateKey=hibernate
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleLidSwitch=suspend
HandleLidSwitch=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
保存文件后,执行 systemctl restart systemd-logind
使其生效。