I cannot figure out how to configure the screensaver to be run (which in turn causes the screen to be locked) every time I shut the lid of my laptop. I have xscreensaver installed and on Xfce it allowed me to configure an action when the lid is shut. Well, not on Gnome 3 :-( Any ideas?

Edit: I do not want the computer to suspend/hibernate when I shut the lid; simply blank the screen.


From this answer: https://superuser.com/questions/748482/how-to-suspend-from-lockscreen-in-gnome-3 , in your /etc/systemd/logind.conf change the line to:


and then sudo systemctl restart systemd-logind to restart the service.


in your /etc/systemd/logind.conf file, add the line


or if that doesn't work,


Source: http://www.freedesktop.org/software/systemd/man/logind.conf.html

  • Don't know if it matters but he's on Fedora. – slm Aug 15 '13 at 16:16
  • Releated: forums.fedoraforum.org/showthread.php?t=292190. That variable can also take the value lock. – slm Aug 15 '13 at 16:23
  • Agreed that comment was more to guard you if others come along in the future and see the difference they'll know that it was already addressed by your follow-up comment. I also provided a link to fedoraforum with the same solution for added protection. – slm Aug 15 '13 at 16:25
  • Yes, that would work if I wanted the machine to suspend. But I simply want to blank the screen and lock it at the same time when I shut the lid, not suspend. – mart1n Aug 16 '13 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.