Screen-lock with xlock on persistent live USB Ubuntu 8.10 Intrepid

by krisrowland

Continuing to refine my persistent Ubuntu 8.10 install, I came across a peculiar feature: the inability to lock the x-session screen – even if all settings are set to lock the screen after certain events (!). Wanting to use this install in a Uni/work atmosphere, privacy is a good idea.  Not being able to simply lock your screen is really just a pain in the X, and it seems I’m not the only one in this situation.

After some forum trawling, I found that screen-locking was essentially removed from the Live distro of Ubuntu since Dapper because of issues with users being able to lock themselves out of their own sessions (weird, but it happened). I suppose removing the functionality was better than risking a self-lockout, but still…

To enable screen-locking, then, I found a nice third-party screen-locker: xlock. You can install it via Synaptic by searching for xlock:

Installing XLock via SynapticSelect and install the xlockmore package. The xautolock package could be useful, too, although I haven’t used it yet, enabling screen locking after a set idle time.

Once installed, I bound xlock to a hotkey via gconf-editor. Open a terminal. Run gconf-editor. Browse to apps -> metacity -> keybinding_commands. In the field for command_1, enter xlock -mode matrix -background black -foreground grey (for a list of other modes and other tags, read the manpage: man xlock; I made the background black with grey text since the black text on a grey background I had as default was very ugly). Go to apps -> metacity -> global_keybindings and change the field of the run_command_1 entry to whatever hotkey you’d like; I use <Super>l.

I’ve had no issues so far. I think this is a nice solution to this strange problem.

Share this post with AddThis!