LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
Search this Thread
Old 05-26-2005, 09:48 PM   #1
theoldman
LQ Newbie
 
Registered: Jul 2003
Distribution: Slackware 10
Posts: 20

Rep: Reputation: 0
Lock screen (requiring password to unlock) when resuming from suspend


I am currently running Slackware 10 on a Dell C600, (PIII 850mhz, 512MB ram) and am using APM (not acpi) for power management. I have the laptop set up so that when I close the lid, the computer goes to sleep. However, when I open the lid again, it returns me to my desktop without requiring a password. I have tried enabling xscreensaver using both the xcreensaver-demo and KDE control interfaces (in both cases configuring the program to require a password to unlock the screen), suspending the computer by closing the lid, then waiting for the xscreensaver timeout before bringing the computer out of suspend mode, but I am returned to my desktop without being required to enter a password. I am running KDE, and would prefer to use KDE's "lock session" feature instead of xscreensaver to lock the screen (although if xscreensaver/some other program is the only way to make it work, it would be acceptable to me to use it) when I bring the computer back out of suspend mode. I have googled high and low, but have not found a way to configure APM or some apm script to lock the screen when the computer enters into or comes out of suspend. If anyone has any suggestions or guidance as to how I could accomplish locking the screen on suspend/resume, or has any feedback as to why the things I tried above did not work, it would be greatly appreciated. Thanks in advance.
 
Old 05-29-2005, 09:52 AM   #2
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 30
Can't really say for sure, cause I use ACPI. But you might wanna check /etc/apm/event.d/ cause scripts placed here are run each time the system suspends/resumes. This is probably where you can tell xscreensaver to lock the screen RIGHT BEFORE suspending the machine. You also might wanna use xscreensaver-command instead of xscreensaver-demo.

Example:

/etc/apm/event.d/lock.sh

#!/bin/sh
case "$1" in
suspend)
runuser -c 'xscreensaver-command -display :0.0 -lock' [your username]
;;
resume)
runuser -c 'xscreensaver-command -display :0.0 -deactivate' [your username]
;;
esac

Of course, you'll have to enable xscreensaver for this to work.

Goodluck

Last edited by Notwerk; 06-01-2005 at 06:00 AM.
 
Old 12-17-2009, 09:35 PM   #3
pratiks19
LQ Newbie
 
Registered: Dec 2009
Posts: 1

Rep: Reputation: 0
Hi,

I am using slackware 13 (KDE4), and having the same suspend-resume lock issue, using ACPI for power management.

my /etc/acpi/acpi_handler.sh script looks like:

Quote:
#!/bin/sh
# Default acpi script that takes an entry for all actions

IFS=${IFS}/
set $@

case "$1" in
suspend)
xscreensaver-command -display :0.0 -lock
;;
resume)
xscreensaver-command -display :0.0 -deactivate
;;

button)
case "$2" in
suspend)
xscreensaver-command -display :0.0 -lock
;;
resume)
xscreensaver-command -display :0.0 -deactivate
;;

power) /sbin/init 0
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac
I put the suspend & resume cases twice (in italics) as I was not sure where it was to be placed.

The xscreensaver is set to blank screen.

The screen doesnt lock on resume.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The password to unlock the screen cheez_m Ubuntu 2 11-13-2005 07:43 AM
Can unlock screen with root password in my user account - want to change this sm1 Linux - Newbie 2 07-24-2005 05:54 AM
Software Suspend - freezes while resuming TazG Linux - Software 2 08-11-2004 10:19 AM
How to Add Password for Resuming from Suspend (Using apmsleep) Ian Linux - Hardware 0 05-03-2004 10:34 PM
Lock screen password!!! bear7 Linux - Newbie 4 11-12-2003 07:02 PM


All times are GMT -5. The time now is 06:05 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration