You are not logged in.

#1 2009-06-23 03:18:01

krtekz
Member
Registered: 2009-06-17
Posts: 3

How to lock screen after suspend to ram

I use LXDE. After waking up from a successful suspend to ram, the computer goes back directly to where it was, without asking for password. How can I change this? BTW, I suspend by clicking the "Suspend" button on LXDE's logout screen.

Also, how to do the same with KDE4?

Thanks in advance!

Offline

#2 2009-06-23 03:20:39

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: How to lock screen after suspend to ram

You can find this section in your /etc/acpi/handler.sh and add in the line starting with DISPLAY, substituting whatever screen lock you use (slock, xscreesaver,lockx, etc). Make sure you edit the username -- although I honestly don't know how to handle it if you have multiple users.

 button/lid)
                #echo "LID switched!">/dev/tty5
                s2ram -f
                DISPLAY=:0 su -c - <username> /usr/bin/lockx
                ;;
        *)

Good luck!
Scott

Edit-- Darn it, I didn't read your post carefully enough. The above is specifically for a laptop when the lid is shut. I don't actually have the answer to your question. I use xautolock to suspend my LXDE machine automatically after 10 min, and it has the option built in to activate the screen lock on resume. But if you select it directly from the LXDE menu, I'm not sure how to accomplish that. Sorry!

Last edited by firecat53 (2009-06-23 03:26:45)

Offline

#3 2009-06-23 03:33:24

krtekz
Member
Registered: 2009-06-17
Posts: 3

Re: How to lock screen after suspend to ram

Thank you for your answer. In my /etc/acpi/hander.sh, there's no "s2ram -f" in the "button/lid" section. And, as you guessed, this is a desktop and I have to click the "Suspend" button to suspend it.

firecat53 wrote:

You can find this section in your /etc/acpi/handler.sh and add in the line starting with DISPLAY, substituting whatever screen lock you use (slock, xscreesaver,lockx, etc). Make sure you edit the username -- although I honestly don't know how to handle it if you have multiple users.

 button/lid)
                #echo "LID switched!">/dev/tty5
                s2ram -f
                DISPLAY=:0 su -c - <username> /usr/bin/lockx
                ;;
        *)

Good luck!
Scott

Edit-- Darn it, I didn't read your post carefully enough. The above is specifically for a laptop when the lid is shut. I don't actually have the answer to your question. I use xautolock to suspend my LXDE machine automatically after 10 min, and it has the option built in to activate the screen lock on resume. But if you select it directly from the LXDE menu, I'm not sure how to accomplish that. Sorry!

Offline

#4 2009-06-23 06:09:47

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to lock screen after suspend to ram

You haven't mentioned which suspend method you're using, so it's not possible to give a definitive answer. Have you read the suspend-to-ram wiki page?

Offline

#5 2009-06-23 16:42:40

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: How to lock screen after suspend to ram

Xscreensaver checks the time on resume and activates if it's been more than the timeout.  It wouldn't work if you want to lock the screen and come back to it in only a few minutes (but in that case you probably wouldn't want to use suspend anyway).

Offline

Board footer

Powered by FluxBB