I had some free time at work, so I finished up my perl script that uses a Parallax RFID USB reader and locks/unlocks the xscreensaver depending on whether and RFID tag is present. One unique problem I had faced is that xscreensaver doesn’t allow you to actually unlock it from the command line (well, without manually killing the process). I found that the program “xdotool” will emulate the keyboard then, and triggered the program to manually enter my password and press enter. One cool feature of the script is that it won’t enter your password unless it detects the screensaver running, so you don’t have to worry about your password being erroneously entered into whatever program has focus. I originally had plans of using an Arduino to emulate a keyboard and enter my password, but that would still require some sort of daemon running to avoid the password being revealed. This program is going to save me countless “free hugs” emails to my coworkers from leaving my screen unlocked.
Check out the video below!
Stealth RFID Screensaver Auto Lock/Unlock