Dec. 17, 2013

Here is how you can have a lockscreen on Xubuntu that just displays a custom logo/graphic and asks for your password. The graphic I have used is a white logo on black background, so the background/foreground settings reflect that but you can change these colours to match whatever graphic you use.

sketch of a padlock

First, you need to create a script in $HOME/bin/xflock4 - this should override the default xflock4 script on your system that XFCE uses as a proxy for launching the lock screen. Here are the contents, which just run the xlock program:

#!/bin/sh
xlock

Don't forget to make it executable with chmod 755 ~/bin/xflock4.

Next, you should create an xpm version of the graphic that you want to use, for example in $HOME/.lock.xpm - you can use the Imagemagick convert program (sudo apt-get install imagemagick) to convert some other image into the correct xpm format like this:

convert myimage.png ~/.xlock.xpm

Make a note of the dimensions of your image as you will need them for the 'icongeometry' option below. The largest size appears to be 256x256 pixels and the man page advises to make it as close to square as possible. You will set the 'image.bitmap' setting below to the location of the xpm file. Finally, you should add the following configuration options to a file called $HOME/.Xdefaults:

XLock*mode: image
XLock*image.bitmap: /home/chrism/.lock.xpm
XLock*image.count: 1
XLock*image.erasedelay: 0
XLock*erasedelay: 0
XLock*icongeometry: 180x180
XLock*background: Black
XLock*foreground: White
XLock*description: off
XLock*info:

You can find out other options by running man xlock.

To test select 'Lock Screen' from the user menu.

Enjoy!