LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   kscreensaver no longer locks screen on suspend to ram in 12.1 (https://www.linuxquestions.org/questions/slackware-14/kscreensaver-no-longer-locks-screen-on-suspend-to-ram-in-12-1-a-679851/)

bl0tt0 10-29-2008 04:39 PM

kscreensaver no longer locks screen on suspend to ram in 12.1
 
The subject pretty much says it all.

I upgraded my installation from 12.0 to 12.1 on a thinkpad t42p, and now the screen doesn't lock when I close the lid. I never used the acpi functions built into kde before, because I found some custom scripts that worked just fine. In 12.0, the screen would lock on a lid event, but now it opens back up to my desktop. Has anyone else had this issue. If so, how did you fix it?

robel 10-31-2008 02:03 AM

I think you need a key event for the lid close key and do something like this:

echo mem > /sys/power/state

I had to do a echo 3 > /proc/sys/kernel/acpi_video_flags in rc.local in order to be able to restore the screen from a suspend to memory.

dive 10-31-2008 02:05 AM

I've just been looking into doing this. I usually run a script manually but to have the script run when the lid is closed you need to edit /etc/acpi/acpi_handler.sh:

Code:

#!/bin/sh
 # Default acpi script that takes an entry for all actions
 
 IFS=${IFS}/
 set $@
 
 case "$1" in
  button)
    case "$2" in
      power) /sbin/init 0
          ;;
        lid) su dive -c /home/dive/scripts/suspendlock
          ;;
      *) logger "ACPI action $2 is not defined"
          ;;
    esac
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
 esac

The lid line points to my script which contains the suspend commands and xscreensaver command (rather than kscreensaver). You need the su -c or xscreensaver will complain and go into an endless loop saying it can't open display.

Of course you will also need to turn off the thinkpad lid option in kde control centre to use the acpi handler or there will be conflicts I should imagine.

Hope it's useful for you.

dive 10-31-2008 02:26 AM

By the way, I looked at kde options but couldn't find any option to start kscreensaver after resuming, so I imagine they have changed that. If there is a way I would also like to know because I've noticed that xlock doesn't work on resume on my T42 so I had to use 'xscreensaver-command -lock' with a while loop to make sure that no user commands/programs are executed until a pass is entered, which is a completely untidy hack.


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