The officially official Devuan Forum!

You are not logged in.

#1 Today 07:43:14

tux_99
Member
Registered: 2025-06-17
Posts: 88  

How to have a dynamic desktop background with Xearth on Devuan XFCE

I'm not sure if there is anybody else out there who still likes to use Xearth as a desktop background but just in case I'll share here how I got Xearth working on Devuan XFCE.

For those who don't know, Xearth is a program written in the 90's that generates a 3D image of the earth showing it's current position with shading for the sides where it's night. See the homepage of Xearth: https://xearth.org/

To build Xearth just download the source code tarball from the above link, apply the below patch (otherwise the build fails) and then run xmkmf and then make.

diff -uNr xearth-1.1-orig/gifout.c xearth-1.1-new/gifout.c
--- xearth-1.1-orig/gifout.c	1999-11-07 07:51:34.000000000 +0100
+++ xearth-1.1-new/gifout.c	2025-12-03 11:17:28.970312517 +0100
@@ -44,6 +44,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include "port.h"
 #include "gifint.h"
 #include "kljcpyrt.h"

After 'make' completes you will find the generated binary 'xearth' and the man page that you can copy to /usr/local/bin and /usr/local/man.

To actually use xearth as a desktop background in XFCE I added the following lines to /etc/rc.local:
(I chose /dev/shm as temp folder for the generated images as that's in RAM to reduce write cycles on the SSD)

# create initial xearth desktop background images
/usr/bin/su - user -c "/usr/local/bin/xearth -grid -ppm -size 1920,1080 > /dev/shm/desktop-01.ppm"
/usr/bin/ln -fs /dev/shm/desktop-01.ppm /dev/shm/desktop-02.ppm

Replace 'user' with you actual username that you use to login to your PC and adjust the size parameter to match your screen resolution.

Then add the following entry to the crontab of your user (again adjust the resolution to suit your screen):

*/5 * * * * /usr/local/bin/xearth -grid -ppm -size 1920,1080 > /dev/shm/desktop-01.ppm ; DISPLAY=:0.0 /usr/bin/xfdesktop -N

This will generate a new image every 5 minutes and refresh your desktop background with this newly generated image.

Last thing, you need to configure the Desktop Settings -> Background of XFCE as follows:

Folder: /dev/shm/
Style: Centered
Colour: Transparent
[X] Apply to all workspaces   (this is optional)
[X] Change the background [at start up]

And here is a screenshot of how it looks like (obviously the part of the earth seen changes over the course of the day and the earth axis inclination changes over the course of the year so this is simply a snapshot of how it looked like when I made the screenshot):
http://pkgrepo.linuxtech.net/files/Scre … xearth.png

Enjoy! smile

Last edited by tux_99 (Today 08:09:08)

Online

Board footer