Lock the screen when I close my laptop's lid

Hi, it would be great if I could lock my laptop’s screen simply by putting the lid down, right now I need to wait 5 mins (by default) until the screen turns off in order to see this happen. I’m not sure if there is a tweak that would allow me to achieve this but I’ll be happy to hear.

2 Likes

Hi @y0n1 , welcome to the forum. Please take a look at the introductory posts in the #start-here category if you’ve not had a chance to do so yet.

Do you mean closing the lid? My laptop here suspends when the lid is closed, and when the lid is opened later, it resumes from suspend but goes to the lock screen first.

Have you disabled suspend on lid-close perhaps?

1 Like

Hi Ankur,
Thanks for replying :slight_smile:
In reply to your question “Have you disabled suspend on lid-close perhaps?” the answer is no.
Btw, my laptop behaves the same as yours in that aspect. What I would like to happen is that by closing the lid the computer will first lock itself and later after it has been idle enough time it would suspend/sleep.

1 Like

I don’t think this can be done from Gnome settings. We’ll probably have to try configuring logind. Take a look at man logind.conf. I think:

HandLidSwitch=lock
IdleAction=suspend
IdleActionSec=5

should do it.