Adding a gif-file as a screensaver to xscreensaver

If you want to have a gif as a screensaver there are probably a lot of solutions. For example this

Man Bowl

loop as a screensaver could easily be created as a screensaver with xscreensaver and gifview [part of gifsicle (ArchLinux)]. In the ~/.xscreensaver file is a section with “programs:”, in that one you can add programs, which can write into the root window and understands “virtual root” windows.

Now that part of xscreensaver looks like:


programs:                                                                     \
-                               maze -root                                  \n\
- GL:                           superquadrics -root                         \n\
                                sh /path/to/script/           \n\
-                               attraction -root                            \n\

The script looks like:



ln -sf "${GIFFILES[RANDOM % ${#GIFFILES[@]}]}" $GIF
gifview --animate --min-delay 5 --window $XSCREENSAVER_WINDOW $GIF

This will set a symbolic link to a specific file of a set of gif images for each display. We get a random gif for the display in the line which stats with ‘ln -sf’. But there is still a lot of improvement to do, e.g. displaying them centralized and not repeated and so on. The minimum delay in gifview gives the time of 1/100s between the display of each frame, this helped me with one gif, which was otherwise running too fast.

If you now open the configuration panel of xscreensaver with

# xscreensaver-demo

You should see in the small preview window of Sh the gif, which is mentioned in the configuration file. The preview button should show you, how it would be too see your endless loop in action.


man 1 gifview
man 1 xscreensaver


~ by frankooh on 2013-08-01T12:35:02+01:00.

One Response to “Adding a gif-file as a screensaver to xscreensaver”

  1. Thank You for this, Using this,
    I have made a screensaver that downloads
    into /tmp (im on arch and this is a tmpfs)
    and displays it.

    love it because im a snowboarder.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: