Howto Add Your Xscreensavers To Gnome Screensaver

July 25th 2006

The fully qualified directories in this particular “howto” are specific to SLED 10, and will undoubtedly be different on a different version of Linux.

Something you might notice on installing SLED 10 is that, like most distros which feature Gnome 2.12 or 2.14, xscreensaver has been partially or fully replaced by gnome-screensaver. In the case of SLED 10, xscreensaver was installed, but none of its screensavers were available; gnome-screensaver listed only a scant five or six options.

I spent some time tracking down how to make xscreensaver’s hacks available to gnome-screensaver, so here it is.

Each screensaver, for both gnome-screensaver and xscreensaver, has a config file. So to move files from xscreensaver to gnome-screensaver, we need to move not only the screensaver programs themselves, but also the config files.

Moving the screensavers is the easy part; all you’d need to do is:


cp -i /usr/lib/xscreensaver/* /opt/gnome/lib/gnome-screensaver/gnome-screensaver/

Yes, technically this code copies the screensavers, not moves them… but that’s okay. The -i switch is to make the process interactive; if any other the new screensavers has the same name as an existing one, it will as if you want to overwrite it, rather than just deciding for you. There should be only one such anomaly: popsquares. I chose not to overwrite it, as it works fine already and is probably exactly the same.

Next, you need to move the config files. The only problem is, xscreensaver config files are .xml files, and gnome-screensaver files are .desktop files.

It turns out that this is a problem with a ready made solution: our friends at Gnome have a script which will migrate our .xml files into .desktop files. For this to work, you’ll need 2 files:

migrate-xscreensaver-config.sh

xscreensaver-config.xsl

Just click the “download” links on the above two pages. I moved the two files to /opt/gnome/lib/gnome-screensaver/, but you can put them anywhere — they just need to be in the same place.

You’ll need to make migrate-xscreensaver-config.sh executable (it should go without saying, but you’ll need to execute the following command from whatever directory you put the files in):


# chmod +x migrate-xscreensaver-config.sh

That being done, all you’ll have left is:

# cd /opt/gnome/share/gnome-screensaver/themes/
# /opt/gnome/lib/gnome-screensaver/migrate-xscreensaver-config.sh /etc/xscreensaver/*.xml

That’s that. You will find (at least on SLED 10) that you need to restart X — just logging out of Gnome and back in should do it.

If you’re attempting to use these steps on a different version of linux, you may need to use find or locate to figure out the proper file paths to use. Enjoy.

blog comments powered by Disqus