Re: Xscreensaver is Active on Resume from Manual Suspend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sat, 3 Dec 2011 13:06:55 +0100
Bastien Dejean <nihilhill@xxxxxxxxx> wrote:

> Hi,
> 
> I would like to know why I see xscreensaver when I resume from suspend
> even if I manually suspend.
> 
> Greetings,

Xscreensaver does not activate by default on resume unless:
1. The time interval between suspend and resume is longer than xscreensaver
timeout.
2. There is an explicit script in /etc/pm/sleep.d which locks thescreen on
resume. For example:
#!/bin/bash
pid=$(pidof -o %PPID /usr/bin/xscreensaver)
case $1 in
	hibernate)
		;;
	suspend)
		if [ "x$pid" != "x" ]; then
			x_owner=$(/bin/ps -e u | /bin/grep xscreensaver \
                                  | /bin/grep $pid | \
                                  /bin/awk '{print $1}')
                        /bin/su $x_owner -c \
                         "/usr/bin/xscreensaver-command -lock &> /dev/null"
                fi
		;;
	thaw)
		;;
	resume)
		;;
	*)
		exit 1
		;;
esac

Personally I always prefer to have such a script to prevent unauthorized
access.

-- 
Leonid Isaev
GnuPG key ID: 164B5A6D
Key fingerprint: C0DF 20D0 C075 C3F1 E1BE  775A A7AE F6CB 164B 5A6D

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux