As a astronomy enthusiast, I really like the default screensaver that comes with gnome-screensaver, named “cosmos”. It’s nice but not ideal:
- It has only few images
- Images do not have any captions – it would be very nice to have even some description of what are you looking at
I’ve decided to create a similar screensaver but with other set of images. When the screensaver is ready, we will package it for Debian/Ubuntu as a .deb so other people can install it easily. A screensaver that I have created (and used as an example here) consists of wallpapers downloaded from http://hubblesite.org/gallery/wallpaper/ .
OK, let’s get cracking! I have prepared a template for the deb package – start with downloading it: screensaver-template.tar.gz and extracting it somewhere in your home directory (tar -zxf screensaver-template.tar.gz).
Now it’s time to add some photos – create a directory inside screensaver-template with the name of your choice. I have put my images in screensaver-template/hubble but you should choose a different name. Copy all the images inside your directory, I’m assuming those will be *jpg files.
gnome-screensaver requires XML file that describes your images – you will find a script inside my package that create the xml file for you: copy create-xml.sh inside your directory with pictures and run it. It will generate background-1.xml file. Have a look inside – it’s pretty straight forward. It assumes that all your images will go into /usr/share/backgrounds/<YOUR_DIR>/. Remove create-xml.sh from your directory – we won’t need it there.
gnome-screensaver also uses .desktop files to manage available screensavers. This file allows you to see your screensaver (it’s acually called screensaver theme) in “Screensaver Preferences”. There is ready to edit file in the template called “hubble-slideshow.desktop”. First rename it to “<YOUR_DIR>-slideshow.desktop” – replace <YOUR_DIR> with the same name as your directory for consistency. Edit the file, you will need to change 3 lines:
- Name – put a short name of your screensaver theme. This will be visible in “Screensaver Preferences”.
- Comment – description
- Exec – here change the path after –location-. It will need to match the path used in the XML file, so it will be –location=/usr/share/backgrounds/<YOUR_DIR>
Now it’s time to create Debian/Ubuntu package, go into debian directory and edit following file:
- README – put general information about your screensaver there
- changelog – edit changelog information: change package name, add anny comment if you with and change the signature. Keep the format of this file as in the template!
- control – change “Source:” and “Package:” lines with the name of your package. Also edit “Maintainer:”, “Homepage:” and “Description:”
- copyright – put all copyright information there
- install – here we are telling package manager that it needs to install two things:
- <YOUR_DIR> into usr/share/backgrounds – rename “hubble” on this line to your directory name
- .desktop file should go into usr/share/applications/screensavers – rename hubble-slideshow.desktop to <YOUR_DIR>-slideshow.desktop
Go up from “debian” directory and run command:
% dpkg-buildpackage
That’s it!! You will find you package in the directory above named gnome-screensaver-<YOUR_DIR>_0.1_all.deb – install it just like any other package and enjoy your new theme!
Here is the screensaver theme I have created: gnome-screensaver-hubble_0.1_all.deb. It’s nearly 50MB package with 81 images from Hubbe site – enjoy!
5 Comments
Thanks for this tutorial. When carrying out the steps, I had to install dpkg-dev and dh-make but it still won’t work for me. When I run ‘dpkg-buildpackage’, I get the following error:
cp: cannot stat `debian/tmp/gemma-slideshow.desktop’: No such file or directory
dh_install: cp -a debian/tmp/gemma-slideshow.desktop debian/gnome-screensaver-gemma/usr/share/applications/screensavers/ returned exit code 1
make: *** [binary] Error 2
dpkg-buildpackage: error: debian/rules binary gave error exit status 2
I’m using Ubuntu 10.04 and all references to ‘hubble’ in the files you provided have been replaced with ‘gemma’ (I’m making a screensaver of the actress Gemma Atkinson
). Any idea what I’m doing wrong?
Did you rename hubble-slideshow.desktop inside screensaver-template to gemma-slideshow.desktop ?
Turns out that the file was still called ‘hubble-slideshow.desktop’. I originally renamed it to ‘gemma-slideshow.desktop’ in the Ubuntu File Browser GUI but it was still showing up as ‘hubble-slideshow.desktop’ in the terminal. Once I renamed it again through the terminal, everything worked. Thanks for your help.
First off, great tutorial! Well explained and easy to follow. However I’m having one issue. Once the screensaver kicks in it only shows a black screen. I downloaded your hubble package to make sure that it wasn’t an error in my package only, but unfortunately it also shows a black screen. However, it works fine through the screensaver preferences preview. Any ideas?
Excellent tutorial! Thank you for sharing this.
One Trackback/Pingback
[...] wanted to build simple screensaver using public domain images and information. For this, I needed to create a lot of static .gif [...]
Post a Comment