<style>
   div.gray {color:gray;}
</style>

# Let it snow!

## 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.
 
Xsnow has an interesting history: [read more....](./history)

<a href="#components">Components</a> | 
<a href="#screensaver">Usage as screen saver</a> | 
<a href="#frontend">Graphical front end</a> | 
<a href="#monitors">Multiple monitors</a> | 
<a href="#multilingualism">Multilingualism</a> | 
<a href="#selfreplication">Self replication</a> | 
<a href="#installation">Installation</a> | 
<a href="#otherplatforms">Xsnow on other platforms</a>

***

<a id="components"></a>

## Xsnow: components

1. **Snow**

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.
Snow is available in two colors.

2. **Santa**

You can choose between a number of Santa visualisations, with or without Rudolph.

3. **Scenery**

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.

4. **Birds**

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.

5. **Meteorites**

Now and then you will notice orange lines in the sky. These are meteorites. 

6. **Stars**

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.

7. **Moon**

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](https://unsplash.com/photos/wCujVcf0JDw).
Santa likes to show off and will place Himself in front of the moon if possible.

8. **Aurora**

Inspired by a visit to Spitsbergen, I created a visualisation of the aurora. 
The aurora is dynamic: it changes shape slowly.  
You can define the width, height, placement, luminosity and animation speed.  
And, of course, you can choose not to display the aurora at all.

9. **Settings**

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 <b>position of
fallen snow</b>, 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 <b>busy</b> with snowing, you can lower the cpu factor somewhat. 

The <b>scale</b> slider affects the scale of all drawings, except for the birds: they have their own scale slider.

<a id="screensaver"></a>
    
## Usage as screen saver
Xnsow is not designed for use as a screen saver, but it works very nicely with 
[xscreensaver](https://www.jwz.org/xscreensaver/). The flag '-root' is meant for this purpose,
see the man page and search for '-root'.

<a id="frontend"></a>

## 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()`.

<a id="monitors"></a>

## Multiple monitors

Many people have two or more montors attached to their PC. Normally this is done using
the 'xinerama' protocol. Originally, xsnow considered multiple
monitors as one large desktop and was snowing on all of them. This has been changed: 
you can now choose on which monitor it is snowing, and you can still choose to snow on 
all monitors at the same time.

<a id="multilingualism"></a>

## Multilingualism

Using the [gettext method](https://www.gnu.org/software/gettext/), the 
free translation engine [mymemory](https://rapidapi.com/translated/api/mymemory-translation-memory)
and [google](https://translate.google.com), I managed to get some translations in xsnow.

These translations will often not be entirely correct 
([mymemory](https://rapidapi.com/translated/api/mymemory-translation-memory) sometimes 
gives surprising results), so I encourage you to provide better translations. 
(Use the [contact form](../contact) to reach me.)

<a id="selfreplication"></a>

## Self replication

Inspired by [this page](/software/selfrep/index.html) 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.

<a id="installation"></a>

## Installation

On many distributions, xsnow is available as a package, for example on debian-based systems:

    sudo apt install xsnow

and you are ready to go. However, if you want a newer version than provided by your package
manager, or if your package manager does not contain xsnow, go to [Downloads](./downloads).

<a id="otherplatforms"></a>

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_YYYxsnow-versionZZZ-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:
 * libx11-dev
 * libxpm-dev
 * libxt-dev
 * libxext-dev
 * libxtst-dev
 * libxinerama-dev
 * pkg-config
 * libgtk-3-dev
 * libgsl-dev
 * 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
   sudo apt install libxinerama-dev libxtst-dev libgsl-dev
~~~~
* In other environments (Suse, Redhat, ...): I am sure you know how to install these packages ;-)
* Download the file xsnow-YYYxsnow-versionZZZ.tar.gz (see the Downloads page)
~~~~
   umask 022
   tar xf xsnow-YYYxsnow-versionZZZ.tar.gz
   cd xsnow-YYYxsnow-versionZZZ
   ./configure
   make
   sudo make install
~~~~
* Xsnow should now be installed as `/usr/local/games/xsnow`

Enjoy!

### 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](https://janswaal.home.xs4all.nl/iSnow/). 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, an 
[excellent version](https://janswaal.home.xs4all.nl/WinSnow/) is available already,
made by the Godfather of Xsnow: Rick Jansen!

