Gentoo Wiki


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc



XScreenSaver is a widely used and useful tool to prevent pixels in your monitor from burning in. One aspect of the XScreenSaver is it's Lock/Unlock feature which allows you to leave your PC unattended safely. The Unlock dialog, however, looks merely functional and most would argue that it looks bad. This article will explain how you can alter the Unlock Dialog box of the XScreenSaver and make it look prettier.

What you will need

For the bare minimum, you will need these:

  1. A running Gentoo Linux system
  2. X Server
  3. Alan Swanson's XScreenSaver Theme Patch

For customizing further, and adding your own logo, you will also need these:

  1. Your own logo
  2. A Pixmap editing utility

Removing XScreenSaver

You will first have to remove your existing installation of XScreenSaver. This needs to be done because the patch will be compiled into your XScreenSaver. Run this command as root:

emerge -C xscreensaver

Download the Theme Patch File

Depending on which version of XScreenSaver you have, download the appropriate patch.

Upto XScreenSaver 4.20 -> Download Patch 1.0

Over XScreenSaver 4.20 -> Download Patch 1.1

Create a local ebuild

We will be creating our own ebuild for this patch. Therefore, we need to add a Portage Overlay Directory and make a few changes in the original ebuild file. This will ensure the local ebuild takes precedence over the original ebuild

 echo PORTDIR_OVERLAY=\"/usr/local/portage/\" >> /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/ 

Then, edit your original XScreenSaver ebuild file (We will use XScreenSaver 4.20 in this HOWTO) :

File: xscreensaver-4.20.ebuild
 src_unpack() {
  unpack ${A} 
  cd ${S}

  ------ LINES ADDED ------
  #XScreenSaver Lock Patch
  epatch ${FILESDIR}/xss-lock-theme-1.0.patch
  ------ LINES ADDED ------

  # disable rpm -q checking, otherwise it breaks sandbox if rpm is installed
  epatch ${FILESDIR}/${PN}-4.20-norpm.patch
  # set default fortune to /usr/bin/fortune even if one can't be found
  epatch ${FILESDIR}/${PN}-4.14-fortune.patch
  # disable not-safe-for-work xscreensavers
  use offensive || epatch ${FILESDIR}/${PN}-4.16-nsfw.patch

You can also use this diff against -4.23-r1 that gives you use-flags for the themes:

File: xscreensaver-4.23-r1.patch
 --- /usr/portage/x11-misc/xscreensaver/xscreensaver-4.23-r1.ebuild      2006-02-07 13:17:34.000000000 +0100
 +++ /usr/local/portage/x11-misc/xscreensaver/xscreensaver-4.23-r1.ebuild        2006-03-01 23:14:50.000000000 +0100
 @@ -4,10 +4,12 @@
 inherit eutils flag-o-matic pam fixheadtails autotools
 -IUSE="gnome jpeg kerberos krb4 insecure-savers new-login nls offensive opengl pam xinerama"
 +IUSE="gnome jpeg kerberos krb4 insecure-savers new-login nls offensive opengl pam xinerama theme-default theme-entity theme-darkalu"
 DESCRIPTION="A modular screen saver and locker for the X Window System"
 @@ -70,6 +72,15 @@
         unpack ${A}
         cd ${S}
 +       if use theme-default || use theme-darkalu || use theme-entity; then
 +               epatch ${FILESDIR}/xss-lock-theme-1.1.patch
 +       fi
 +       if use theme-darkalu; then
 +               unpack xss-theme-darkalu10-lcd-1.0.tar.gz
 +       fi
 +       if use theme-entity; then
 +               unpack xss-theme-entity-1.0.tar.gz
 +       fi
         # disable rpm -q checking, otherwise it breaks sandbox if rpm is installed
         # use gnome-terminal in tests rather than gnome-open (bug #94708)
         # and bug 118028:

You can apply it with (I think)

patch < xscreensaver-4.23-r1.patch

Then run:

ebuild xscreensaver-4.20.ebuild digest

Installing XScreenSaver

You should be ready to emerge the XScreenSaver package now:

emerge xscreensaver

Screenshots of Default Theme

Some screenshots are available on Alan Swanson's Site

Adding your own Logo be added soon.

Author and Credits

This page was written by Sheran Gunasekera <> Feedback is always welcome

In addition, Special Thanks go out to the following people:

Oliver Grawert - Customized the dialog in Ubuntu Linux & provided valuable guidance
Alan Swanson - Creator of the XScreenSaver Patch
Jamie Zawinski - Creator of XScreenSaver
Retrieved from ""

Last modified: Fri, 05 Sep 2008 07:04:00 +0000 Hits: 15,568