You are not logged in.
I have xscreensaver lock setup to lock the screen when resuming. Xscreensaver-lock shows up successfully, I log in, etc. But just a few seconds after logging in, the system suspends again.
I'm not really sure what's causing this.
I used the shell script from the wiki to have Xscreensaver lock my screen on resume:
#!/bin/sh
#
# 00screensaver-lock: lock workstation on hibernate or suspend
DBUS=$(ps aux | grep 'dbus-launch' | grep -v root)
if [[ ! -z $DBUS ]];then
USER=$(echo $DBUS | awk '{print $1}')
USERHOME=$(getent passwd $USER | cut -d: -f6)
export XAUTHORITY="$USERHOME/.Xauthority"
for x in /tmp/.X11-unix/*; do
DISPLAYNUM=$(echo $x | sed s#/tmp/.X11-unix/X##)
if [[ -f "$XAUTHORITY" ]]; then
export DISPLAY=":$DISPLAYNUM"
fi
done
else
USER=username
USERHOME=/home/username
export XAUTHORITY="$USERHOME/.Xauthority"
export DISPLAY=":0"
fi
case "$1" in
hibernate|suspend)
su $USER -c "/usr/bin/xscreensaver-command -lock" & # or any other such as /usr/bin/xscreensaver-command -lock
;;
thaw|resume)
;;
*) exit $NA
;;
esac
How do I prevent the system from suspending again after logging in?
Last edited by spo11 (2011-11-20 22:20:10)
Offline
Are you using a laptop? I had the same problem with my computer but solved it after some research.
In /etc/acpi/handler.sh at the end it looks something like:
button/lid)
/usr/sbin/pm-suspend
#echo "LID switched!">/dev/tty5
;;
Edit it to:
button/lid)
if [[ `cat /proc/acpi/button/lid/LID/state | awk '{print $2}'` = "closed" ]]
then
/usr/sbin/pm-suspend
fi
#echo "LID switched!">/dev/tty5
;;
I hope that'll help you
Offline
i was just hopping online because lately i've been having the same issue. This seems to have worked for me. Thanks.
Offline
Are you using a laptop? I had the same problem with my computer but solved it after some research.
In /etc/acpi/handler.sh at the end it looks something like:button/lid) /usr/sbin/pm-suspend #echo "LID switched!">/dev/tty5 ;;
Edit it to:
button/lid) if [[ `cat /proc/acpi/button/lid/LID/state | awk '{print $2}'` = "closed" ]] then /usr/sbin/pm-suspend fi #echo "LID switched!">/dev/tty5 ;;
I hope that'll help you
That worked like a charm!
Thank you so much. I was unable to find a solution elsewhere.
For others who might be having this problem, you might need to change LID in the code ri posted above to whatever it is listed as for your system. Mine was LID0. To check, just
$ cd /proc/acpi/button/lid
$ ls
LID0
Offline
For those who have modified /etc/acpi/handler.sh to add a suspend action on "button/lid", kernel 3.1 has changed the ACPI events slightly, causing similar behavior. Perhaps the events are linked in some way?
I've filed a bug report: https://bugs.archlinux.org/task/27201
Offline
the use of acpid always brings up this issue.
It duplicates the desktop manager's call for pm-suspend, one arrives first, the other arrives after resuming the system.
The cure: remove one of the methods to call pm-suspend.
I rather not to use acpid, I don't need it anyway.
Offline