

- Customize xscreensaver lock screen movie#
- Customize xscreensaver lock screen code#
- Customize xscreensaver lock screen password#
Instead, when xsecurelock is forking itself to start your program, it sets up the stdin file descriptor to contain a one-character buffer of what the user has typed so far. Because XSecureLock overrides a lot of X11’s behavior with regards to keyboard events, you can’t just use the standard XNextEvent to handle key press events. The second thing your program needs to do to work with XSecureLock is handle keyboard input via a special file descriptor. Open display _display = XOpenDisplay ( NULL ) // Get window from XSecureLock const char * env_window = getenv ( "XSCREENSAVER_WINDOW" ) if ( env_window != NULL & env_window != 0 ) // Map window to display XMapWindow ( _display, _window ) Simply open the display via XOpenDisplay, then call XMapWindow with the result of XOpenDisplay and hand it the unsigned long long value of XSCREENSAVER_WINDOW. The first is an environment variable called XSCREENSAVER_WINDOW, which actually refers to the X11 root window your program uses to draw into. To make it so your screen locker works with XSecureLock, there are only two things your program needs to use. API wise, Cairo is really similar to Apple’s CoreGraphics library, which I was already really used to. For graphics, I used the wonderful Cairo Graphics library. I hadn’t written a big C program in a long time, so I thought it might be fun to do it again.

That being said, I expressed no creativity with regards to the programming language choice and just went with C. All you need to do is return 0 from your main function on success, or non-zero on failure. The cool thing about each part being separate executables is that you can write each piece in whatever language you choose, because there aren’t even any dependencies between them. Therefore, a custom screen locker would fit in right between the authenticator and XSecureLock itself. Lastly, XSecureLock provides an authentication program, intended to be forked from your “saver”, which is responsible for asynchronously doing the work of authenticating with libpam.
Customize xscreensaver lock screen password#
XSecureLock refers to this as the “saver”, because it assumes you’re using a screen saver to show the password dialog (for instance, XScreenSaver provides this functionality via a shared dialog window for all hacks). The first is the actual xsecurelock executable, which blanks the screen, captures all input from the keyboard and mouse, and continuously prevents any other window from appearing on top of it and stealing focus. The modular part of XSecureLock is that it’s separated into three separate executables, launched in order. XSecureLock was designed to do the “heavy lifting” for you with regards to handling the challenges/gotchas with actually making sure your screen is locked, and no other program in the background can steal focus.
Customize xscreensaver lock screen code#
After examining the source code a bit, I was also pleased to discover just how modular it is. I had been using XSecureLock for quite some time now. I’ve been getting really into Linux on the desktop recently, so I thought this would be a great opportunity since I now have the ability to change my login screen to whatever I want. During this scene, the camera pans across the laptop screens of each respective hacker as their computer plays a special, customized animation.Įver since I saw this scene I wanted to do something like this to one of my machines.
Customize xscreensaver lock screen movie#
Moments before the protagonists from the movie Hackers work together to overload the Gibson–after rollerblading through New York City via an undisturbed route of compromised traffic signals–each one of them rolls into a phone booth in Grand Central Station and boots up their laptop.
