Xscreensaver theming

In my humble opinion, xscreensaver is quite ugly. Even worse, xscreensaver doesn’t support theming without recompiling. Jamie Zawinski, the main developer of xscreensaver, justifies his design choice with security concerns.
There were indeed some security vulnerabilities for gnome-screensaver, etc. in the recent years, which allowed to bypass password authtification.

Anyways, by adding some lines to ~/.Xresources, it is at least possible to change some colors and fonts.

Xscreensaver

The above screenshot had the following settings in ~/.Xresources:

xscreensaver.splash: false

!font settings
xscreensaver.Dialog.headingFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.bodyFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.labelFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.unameFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.buttonFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.dateFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.passwd.passwdFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-*

!general dialog box (affects main hostname, username, password text)
xscreensaver.Dialog.foreground: #ffffff
xscreensaver.Dialog.background: #111111
xscreensaver.Dialog.topShadowColor: #111111
xscreensaver.Dialog.bottomShadowColor: #111111
xscreensaver.Dialog.Button.foreground: #666666
xscreensaver.Dialog.Button.background: #ffffff

!username/password input box and date text colour
xscreensaver.Dialog.text.foreground: #666666
xscreensaver.Dialog.text.background: #ffffff
xscreensaver.Dialog.internalBorderWidth:24
xscreensaver.Dialog.borderWidth: 20
xscreensaver.Dialog.shadowThickness: 2

!timeout bar (background is actually determined by Dialog.text.background)
xscreensaver.passwd.thermometer.foreground: #ff0000
xscreensaver.passwd.thermometer.background: #000000
xscreensaver.passwd.thermometer.width: 8

!datestamp format–see the strftime(3) manual page for details
xscreensaver.dateFormat: %I:%M%P %a %b %d, %Y

After changing this file, please don’t forget to reload it with
xrdb -merge ~/.Xresources
and restart xscreensaver.

On a side note: The screenshot above was taken with
xscreensaver-command -lock; sleep 10; import -window root xscreensaver.png

Edits:

  • 2013-05-02 Migrated this article from my old website.
  • 2014-12-16 Again a migration and some minor edits.

Leave a Reply

Your email address will not be published. Required fields are marked *