You are not logged in.
Pages: 1
Hi
I have no screensaver and no DM. I have installed pm-utils and slock. So when i close my lid i want to suspend the laptop and lock the screen with slock. In /etc/acpi/handler.sh under button/lid i wrote:
pm-suspend && slock
but this just suspend the computer without locking the screen.
What am i missing here?
Thanks!
Last edited by Shark (2011-08-15 08:55:57)
If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau
Registered Linux User: #559057
Offline
button/lid)
if [ `/bin/awk '{print $2}' /proc/acpi/button/lid/LID/state` = closed ]; then
DISPLAY=:1.0 su -c - firecat53 /usr/local/bin/lock.sh
/usr/sbin/pm-suspend
fi
;;
The key is setting the DISPLAY since slock is an X program. I had some other pre-suspend stuff in my lock.sh script, but you can just use /usr/bin/slock. You can also play with and see which works better: having slock run before or after the suspend.
Good luck!
Scott
Last edited by firecat53 (2011-07-28 20:51:25)
Offline
Hi
Thanks for help but that doesn't work. I even changed /usr/local/bin/lock.sh to /usr/bin/slock but doesn't do the trick.
If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau
Registered Linux User: #559057
Offline
button/lid) if [ `/bin/awk '{print $2}' /proc/acpi/button/lid/LID/state` = closed ]; then DISPLAY=:1.0 su -c - firecat53 /usr/local/bin/lock.sh /usr/sbin/pm-suspend fi ;;
The key is setting the DISPLAY since slock is an X program. I had some other pre-suspend stuff in my lock.sh script, but you can just use /usr/bin/slock. You can also play with and see which works better: having slock run before or after the suspend.
Good luck!
Scott
Thanks man now it works. I did:
/usr/sbin/pm-suspend
DISPLAY=:0.0 su -c - shark /usr/bin/slock
Last edited by Shark (2011-08-15 08:56:39)
If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau
Registered Linux User: #559057
Offline
Pages: 1