Sunday, 22 July 2018

XScreenSaver autolock on suspend Fedora 28

Lock screen after suspend in Fedora.
sudo vim /etc/systemd/system/xscreensaver.service
Content of the file:
[Unit]
Description=Lock X session using xscreensaver
Before=sleep.target

[Service]
User=ptacnikt
Type=oneshot
Environment=DISPLAY=:0
ExecStart=/usr/bin/xscreensaver-command -lock

[Install]
WantedBy=sleep.target

systemctl enable xscreensaver.service

Try to close and open the lid.