Sample Header Ad - 728x90

How to lock screen on lid closing using systemd?

7 votes
2 answers
4149 views
I am running Sway on Fedora 26 and want my laptop to be locked when I close my screen. I changed HandleLidSwitch to lock in /etc/systemd/logind.conf and ran systemctl restart systemd-logind after that. However, closing the lid does nothing. The lock program I intend to use is Swaylock and I can manually call it by runnig the command swaylock in a terminal. How do I make Systemd call swaylock when it tries to close the screen (as instructed to do in logind.conf)?
Asked by strNOcat (383 rep)
Oct 7, 2017, 09:22 PM
Last activity: Aug 5, 2025, 05:03 PM