LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Lock screen (requiring password to unlock) when resuming from suspend (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/lock-screen-requiring-password-to-unlock-when-resuming-from-suspend-327512/)

theoldman 05-26-2005 09:48 PM

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.

Notwerk 05-29-2005 09:52 AM

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

pratiks19 12-17-2009 09:35 PM

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.


All times are GMT -5. The time now is 07:57 PM.