You are not logged in.

#1 2011-03-14 06:07:22

ShadowKyogre
Member
From: Hell! XP No... I'm not telling
Registered: 2008-12-19
Posts: 476
Website

Locky: Locks all those open X sessions with xscreensaver

This started out as an experiment with suspending and hibernating because I got a little too carried away with playing with code. I first was trying to get the screen to lock on its own when I suspended the computer. Then I grew paranoid about, "What if someone uses the guest account!? How am I going to lock ALL of them!?!??!" And then this little monstrosity popped up.

Code: http://pastebin.com/NzFHUHUh
Download the code, chmod +x the file you saved it as, and call this from a thaw, resume, suspend, or hibernate hook to enjoy screen-locking for all those open X sessions.

[EDIT]: Forgot this info: You should read how to make your own hooks for suspending and hibernating if you don't know how to already.

Credits:
https://bbs.archlinux.org/viewtopic.php?id=68158 For how to lock the screen with a hook, which caused me to write this up.
https://bbs.archlinux.org/viewtopic.php?id=84408 For a little code from this, which helped with pulling out the correct DISPLAY to lock with the right user.

Last edited by ShadowKyogre (2011-03-14 06:27:18)


For every problem, there is a solution that is:
Clean
Simple and most of all...wrong!
Github page

Offline

#2 2011-03-16 19:40:16

ShadowKyogre
Member
From: Hell! XP No... I'm not telling
Registered: 2008-12-19
Posts: 476
Website

Re: Locky: Locks all those open X sessions with xscreensaver

Updated it to be allow using a custom lock mechanism, along with a custom way to pull up active X sessions if your locker isn't xscreensaver. This also adds the feature to disable auto-screenlocking for certain users, like a guest account.

And it's also up on the AUR, so installing it should give you this functionality if you have suspend or hibernate available: http://aur.archlinux.org/packages.php?ID=47477

Last edited by ShadowKyogre (2011-03-16 20:58:20)


For every problem, there is a solution that is:
Clean
Simple and most of all...wrong!
Github page

Offline

Board footer

Powered by FluxBB