Make Linux lock on lid close
Some Windows-oriented computers like Microsoft Surface with “Connected Standby” or “Modern Standby” may not be well supported in Suspend / Sleep with Linux yet. Consider having such a system lock on lid close until the Linux kernel is updated to support these newer power states. For better security in general, shut the laptop down while in transit in case of loss or theft. Locking screen with screen turned off gives sufficient power savings for short walks.
Force Linux lock on lid close with a systemd
-based Linux distro such as Ubuntu by editing “/etc/systemd/logind.conf”, uncommenting line:
HandleLidSwitch=lock
Reboot the computer and verify lock behavior on lid close.
Reference:
- Microsoft description of traditional S3 standby vs. connected standby vs. modern standby
- Lock on lid close may not work when the laptop is physically docked, but does generally work when the laptop is out of dock. Do the manual lock if this doesn’t work when physically docked.