Let it snow!
New: xsnow plays better with xscreensaver, see the 'settings' tab
Xsnow: what does it do?
Xsnow is an application that animates snowfall, Santa and some scenery on your desktop. It is NOT a kind of screen saver: snow is falling, Santa rides his sleigh with reindeer while you are using your system. Xsnow runs on most varieties of Linux, and probably on other Unix systems as well.
In 1984, my colleague Rick Jansen created an application for the Apple Macintosh computer, called, if I remember well: snow. This application animated snow on the desktop, including snowflakes, fallen snow and even Santa flying through the air.
Later on Rick acquired a real system, a Silicon Graphics workstation, and soon he produced a version of snow that could run in an X11 environment: xsnow, first released in 1993. This version shows fallen snow not only at the bottom if the desktop, but also on windows. (Maybe the Macintosh version did this also, difficult to verify now). More information, including links to other implementations, is available on Wikipedia. Rick is still working on snow for the Mac, the program is baptized iSnow. It appears that much eye candy has been added in due time. One could almost be temped to acquire an Apple system to run iSnow! And then, there is even a shareware version, winsnow, that runs on MS Windows.
It seems that xsnow was received well by the community, despite the fact that is was not released in the Public Domain :-(. When you look for xsnow on the WWW, you will find complaints that xsnow does not function well on modern desktops like Gnome and KDE. It seems that there was a solution for KDE, but I found that that solution does not works any more. In Debian, under non-free, xsnow is still offered (version 1.42), but it only works on 'simple' window managers like FVWM that use the root window to place the windows. When you start this version of xsnow, in general you see nothing, because it is snowing behind the desktop.
Towards Gnome xsnow
I waited some years for somebody to solve the snowing-but-not-visible issue, but alas, no solution was provided. So, after almost finishing my findent project, I decided to have a look, in November or December 2018. Before Christmas 2018, I had something running. I let Rick know, and he was very pleased, he said. I succeeded to polish xsnow further and was able to offer a dependable version months before Christmas 2019.
Xsnow has old roots and is adapting to new environments, visible in the code, which is a good thing for an application like xsnow. For example, there is no convention whatsoever for the naming of variables and functions. Something like 'windonfallensnow' can be spelled like: 'windonfallensnow', 'wind_on_fallen_snow', 'WindOnFallenSnow', WOFS and so on. The language used is C, (not C++ as would be the obvious choice now, however: see 'Technical issues' (no, not Python or Ruby: we really need some performance)), with many global variables, sometimes with not very helpful names. The choice whether a function and accompanying header files are placed is separate files or in xsnow.c, is based on the moment of the day, or the flipping of a coin. Xsnow-1.42 hardly used floating point arithmetic, xsnow-2.0 uses a mix of floating point and integer arithmetic, floating point gradually taking over. The documentation contains references to systems that are extinct for many years, but description of new flags has been noted to creep in. Xsnow's genes show traces of findent, and even of some Hitchhikers Guide. The genes for 'toon.h' are almost gone, there are at this moment better ways to find the window to snow in. The program became aware of the fact the Santa's sleigh is pulled by 8 reindeers: Dasher, Dancer, Prancer, Vixen, Comet, Cupid, Dunder and Blixem. Later on, Rudolf could be added. It seems that some of the pixmaps are evolving in that direction.
Since version 3.1.0, xsnow has, next to the 7 handcrafted snow flakes, 300 other randomly generated snowflakes. The 7 snowflakes are still used. If you want only these snowflakes, click 'vintage' in the snow tab.
You can choose between a number of Santa visualisations, with or without Rudolph.
The bottom part of the screen is used to place some scenery: trees, houses, ice bears, reindeer's and mooses. The vintage xsnow Xmas-tree is still available.
Falling snow is nice, and so are flocking birds. The behaviour of a flock of birds emerges from only a few simple rules. In short: birds want to fly at constant speed, fly in the same direction as neighbours and keep a certain distance to neighbours. Luckily, birds are also attracted by an attraction point like a tree, otherwise they would quickly leave the screen... Just search on the WWW for 'flocking birds' and the like and you will find much information about this subject, but no working programs. So I was tempted to try to program this behaviour and visualize it, in 3D. After some tests it appeared that this project was very well doable, and could relatively easily be incorporated in xsnow.
Now and then you will notice orange lines in the sky. These are meteorites.
Xsnow lets twinkle a number of simple stars, you can adjust the number of stars. The stars periodically change color, which gives a rude twinkling effect.
Where there are stars, one expects a moon also. Xsnow shows a moon, with halo. The size of the moon and the luminance of the halo is adjustable. Thanks to Pedro Lasta for a nice moon picture. Santa likes to show off and will place Himself in front of the moon if possible.
Some effort has been put in to let the snow flakes land on precisely the top of the windows and the bottom of the screen. If you are not satisfied with the position of fallen snow, you can adjust that, and write me a note: which desktop/linux distribution are you using, and what goes wrong (screenshot).
If your system is too busy with snowing, you can lower the cpu factor somewhat.
The scale slider affects the scale of all drawings, except for the birds: they have their own scale slider.
Usage as screen saver
Xnsow is not designed for use as a screen saver, but it works very nicely with xscreensaver. The flag '-root' is meant for this purpose, see the man page and search for '-root'.
Graphical front end
My agenda showed some free hours on Kings-day (27 April 2019), which gave me the opportunity to finish the graphical front end. The front end is written using GTK3 and Glade as a designer tool. Details are in
ui.c, ui.h, ui.glade, main.c: do_uicheck().
Inspired by this page I decided to add self-replicating capabilities to xsnow. Because xsnow is a multi-file software project and the making of xsnow id done via many external tools, the feature was relatively easy to implement. Self-replication is switched on by the flag
-selfrep, the man page shows an example.
Since version 2.0~pre5, xsnow is equipped with the standard './configure; make; sudo make install' suite. Even 'make distcheck' works.
If you are running some kind of Debian (Ubuntu, Mint, ...) system and your hardware is of type amd64: On the downloads page, you find a debian package. Download and type
sudo apt install ./xsnow_3.4.3-1_amd64.deb
and you are done. Xsnow will be installed under '/usr/games'.
In general, installing is done like this:
- resolve the following dependencies:
- C compiler (gcc will do fine)
- C++ compiler (g++ is ok)
- In debian-like environments (including Raspbian):
sudo apt install libx11-dev libxpm-dev libxt-dev libxext-dev pkg-config libxml2-dev libgtk-3-dev
- In other environments (Suse, Redhat, ...): I am sure you know how to install these packages ;-)
- Download the file xsnow-3.4.3.tar.gz (see the Downloads page)
umask 022 tar xf xsnow-3.4.3.tar.gz cd xsnow-3.4.3 ./configure make sudo make install
- Xsnow should now be installed as
Xsnow on Apple IOS
There will never be a version of xsnow for Apple IOS, because there is already a very good nephew of xsnow available for Apple IOS. Search for 'iSnow' in the Apple store or have a look at this page. I guess this is enough explanation for Apple IOS users. I have no access to such a system, so I cannot test. BTW: iSnow is written by Rick Jansen, so quality is guaranteed.
Xsnow on MS Windows
I am certainly not planning to port xsnow to windows. Once upon a time there was 'winsnow' (also created by Rick Jansen), but I am unaware of the status. There is some info here. There is a poor man's version of xsnow that runs in a browser (even an Windows browser!): wsnow.