HOME PATCH THEMES APPLYING CREATING |
|
This page contains themes and instructions on creating themes for the XScreenSaver lock window patch. Any comments to me.
xscreensaver lock window themesReplacement for ugly password lock window.xss-lock-theme-1.1.patchold versions |
XScreenSaver is a ubiquitous program on Unix for preventing the pixels of your monitor from burning in, providing pretty animations and providing password protection. However, the default lock window used for password protection is bloody ugly.
The author of XScreenSaver has an explanation on why toolkits like GTK and QT are not used for the lock window and I'd agree with his points. However, why not have a built-in theme that is secure?
So what I'm providing here is a framework for creating built-in themes. (Note that themes are not run time changeable - only one can be included at any time.) The default theme is shown in the first screenshot below and other themes are available. Creating a new theme requires some graphical talent (of which I have none) for the frame and logo and some programming experience if you wish to adjust the interior. Please feel free to submit themes and I will include them on this page.
Important: Not compatible with XScreenSaver 5.00 and newer and I am no longer using XScreenSaver so unlikely to be fixed. Sorry.
Notes: Version 1.1 patches XScreenSaver 4.22 and perhaps newer versions.
(One small hunk failure against 4.21.)
Notes: Version 1.0 patches XScreenSaver 4.15 to 4.20 and perhaps older
versions.
themesVarious themes. |
|
Metallic grey border with green on black body using Neuropol font. This is the default theme included in the patch. Preview. |
|
Metallic grey border with LCD effect body using Neuropol font. xss-theme-darkalu10-lcd-1.0.tar.gz Preview. |
|
Based on the Entity theme for the Fluxbox window manager. By Dean Ashton xss-theme-entity-1.0.tar.gz Preview. |
applyingHow to apply the patch. |
To apply the patch;
$ cd xscreensaver-4.XY
$ patch -p1 < /path/to/xss-lock-theme-1.0.patch
The default theme uses the Neuropol font. This is a free font available on all font sites, use Google to search for it. Download and add it to the X server font directory. If the font is unavailable, the theme will revert back to the default XScreenSaver fonts.
If the XPM's and header file are contained in an archive under a directory named "driver", change to the xscreensaver directory and untar over the existing files;
$ cd /path/to/xscreensaver-4.XY
$ tar xzf /path/to/xss-theme-*.tar.gz
Alternatively, just copy the XPM's and the header straight to the driver directory;
$ cp theme* /path/to/xscreensaver-4.XY/driver/
How to create a local copy of the xscreensaver ebuild with the patch;
$ mkdir /usr/local/portage
Add PORTDIR_OVERLAY="/usr/local/portage/" to the /etc/make.conf file.
$ $EDITOR /etc/make.conf
$ mkdir /usr/local/portage/x11-misc
$ cp -r /usr/portage/x11-misc/xscreensaver /usr/local/portage/x11-misc
$ cd /usr/local/portage/x11-misc/xscreensaver
$ cp /path/to/xss-lock-theme-1.0.patch files/
Add epatch ${FILESDIR}/xss-lock-theme-1.0.patch to the
xscreensaver-4.XY.ebuild file in the src_unpack function after
the cd ${S} line.
$ $EDITOR xscreensaver-4.XY.ebuild
$ ebuild xscreensaver-4.XY.ebuild digest
$ emerge =xscreensaver-XY
The local ebuild will take precedence over the original ebuild.
creating themesNotes on creating themes. |
A theme is made up of nine XPM images and a header file;
| theme.h | Header file containing settings for fonts, colours, sizes and border control. |
| theme_logo.xpm | The logo contained within the body of the window. |
| theme_frame_tl.xpm | Top left corner of border. |
| theme_frame_t.xpm | Top of border. |
| theme_frame_tr.xpm | Top right corner of border. |
| theme_frame_l.xpm | Left side of border |
| theme_frame_r.xpm | Right side of border |
| theme_frame_bl.xpm | Bottom left corner of border. |
| theme_frame_b.xpm | Bottom of border. |
| theme_frame_br.xpm | Bottom right corner of border. |
The XPM image files must to be indexed to 90 colours or less. While this saves on file size by using only one character per colour ("A" versus "AB") in the colourmap, the real reason is that XScreenSaver will abort if it is not one character per colour. This will kill your entire session, not just XScreenSaver.
The XPM declaration has to be changed from the default;
static char * theme_logo [] = {
To a double "const" as below;
static const char * const theme_logo [] = {
The corner images are aligned to the inside of the frame.
The top, bottom and side images are aligned to the outside of the
frame and are drawn as either a repeating pattern or centred once.
For arranging the borders a picture is worth thousand words. The following is a repeating border sized to fit the window.
| Top and bottom image. | ![]() |
20 x 10 | ![]() |
| Left and right image. | ![]() |
30 x 20 | |
| Corner image. | ![]() |
20 x 20 |
As the top and bottom heights are smaller than the corner heights, they are
visually aligned to the outside.
As the left and right image widths are larger than the corner widths, the
corners are visually aligned to the inside.
Corner effects can blur into the side sections, so put a section of background
colour on the inside of the corner and make the sides the actual (smaller) size
of the border. For example

and adjust the internal border as appropriate.
| Defines | Description |
|
THEME_FG THEME_BG |
General foreground and background colours using standard hexadecimal pixel values such as "#A0123F". |
|
THEME_FG_LABEL THEME_BG_LABEL THEME_FG_PASSWD THEME_BG_PASSWD THEME_FG_DATE THEME_BG_DATE THEME_FG_LOGIN THEME_BG_LOGIN THEME_FG_DENIED |
The foreground and background colours for the label fields (LABEL), password fields (PASSWD), date field (DATE), option login button (LOGIN) and status display if password check failed. Uses standard hexadecimal pixel values. |
|
THEME_FONT_LABEL THEME_FONT_PASSWD THEME_FONT_DATE THEME_FONT_STATUS |
The fonts for the label fields, password fields, date field and status display.
Uses the X Logical Font Description Conventions such as; -*-neuropol-*-r-*-*-*-80-*-*-p-*-iso8859-1 The status display is shown when the password is entered and overwrites the body of the window. Unlike the pasword maxmimum string length check, this font size is not taken into account when defining window size so if it is too big it will write into the borders. |
|
THEME_FG_THERMO THEME_BG_THERMO |
The countdown thermometer colours. Note the background is the outline box, not the background which will be the general background colour. |
| THEME_THERMO_WIDTH | The width in pixels of the countdown thermometer. |
|
THEME_TOP_FIT THEME_LEFT_FIT THEME_BOTTOM_FIT THEME_RIGHT_FIT |
Define these if the repeating side pixmaps need to be drawn complete, i.e.
not cut-off on last image. Generally you would define the top and left only as the top and bottom widths or right and left heights will usually be same size. The exception is if the opposing side is centred (in a mixed setting). |
|
THEME_TOP_CENTRED THEME_BOTTOM_CENTRED THEME_LEFT_CENTRED THEME_RIGHT_CENTRED |
Define these if the side pixmaps are to be centred once and not repeated. |
| THEME_INTERNAL_BORDER |
The spacing in pixels between frame and outside edge of logo, test and
thermometer. Remember to take account of background colours in frames and that
side pixmaps are aligned on outside edge. For example, if the corner pixmap is 15x15 with inner 3x3 of background colour (allowing for corner effects) and the edge pixmaps are 12x20 and 20x12 then instead of a border of 15 perhaps select 12. |
| THEME_INTERNAL_SPACER | The spacing in pixels between logo to label, label to password and password to thermometer. |