Lock screen on suspend/hibernate

Please post all general support questions for LXDE here.
Locked
Gullible Jones
Posts: 7
Joined: Thu Oct 23, 2008 1:23 am

Lock screen on suspend/hibernate

Post by Gullible Jones »

Is it possible to make lxsession or lxsession-lite lock the screen (e.g. via xscreensaver-command --lock) on suspend or hibernation? This strikes me as kind of an essential requirement for privacy and whatnot, so I figure there has to be some way to do it...
Gullible Jones
Posts: 7
Joined: Thu Oct 23, 2008 1:23 am

Re: Lock screen on suspend/hibernate

Post by Gullible Jones »

Anyone?
jis
Posts: 3
Joined: Wed Jan 07, 2009 12:49 pm

Re: Lock screen on suspend/hibernate

Post by jis »

gnome-screensaver locks screen after resuming from suspend launched by means configured in gnome-power-preferences.
Last edited by jis on Tue May 05, 2009 10:37 am, edited 1 time in total.
jeevs
Posts: 3
Joined: Tue May 05, 2009 9:30 am

Re: Lock screen on suspend/hibernate

Post by jeevs »

Right click on desktop and create new text file with name: "lockscreen.desktop"

Right click on the file and open with "leafpad"

now paste thefollowing code into it and save it.

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=Lock Screen
Comment=Locks your screen
Icon=xscreensaver
Exec=xscreensaver-command -lock
Terminal=false
Type=Application
cheers.........
jis
Posts: 3
Joined: Wed Jan 07, 2009 12:49 pm

Re: Lock screen on suspend/hibernate

Post by jis »

That creates launcher for manually locking screen, but the question was if this can be done automatically after resume from suspend.

I suppose one could make a custom hook that runs screen lock on resume, see http://en.opensuse.org/Pm-utils#Creating_your_own_hooks for instructions.
Locked