Sunday, August 11, 2013

Wallpapers and System Messages on the Desktop

Being that I use a plain window manager on my machine, the desktop root window is just displaying a calm wallpaper for me. In order to facilitate this, I use Nitrogen (cf. website, debian package). It gives me a GTK+ window with thumbnails of my wallpaper directory. I click on the wanted wallpaper, apply and am good to go.




In Openbox, I call Nitrogen via a key combo (I use SUPER + b, as in background) which runs this command:


 nitrogen --no-recurse --sort=alpha ~/Pictures/wallpapers  


--no-recurse tells nitrogen not to go into subdirectories, which is a smart thing to do considering that file managers make smaller thumbnails of the images and you usually have a hidden subdirectory with loads of tiny pictures you actually don't want to be your wallpaper.

--sort=alpha is sorting the images alphabetically. 
Other options: ralpha - reversed alphabetical order, time - according to modified time, rtime - same as time, but reversed.


Of course, Openbox doesn't know that I want to load a wallpaper at startup, so I put this command in my .xinitrc / .xsession (my .xsession is actually just a symlink to my .xinitrc).


 nitrogen --restore &  


An empty root window with a wallpaper gives me the perfect opportunity to have a sort of live display of my system logs. There is this nifty command tool called tail which lets you view the last 10 lines of a text file in the console, while always listening in and updating, so you always get the last log entries.
The same is available for the root window, but as a different programme called root-tail (website, deb).

I have this in my .xinitrc:

 root-tail -g 800x250+40+460 -font -misc-fixed-*-*-*-*-*-100-*-*-*-*-*-1 /var/log/messages  


-g stands for geometry.  This is the standard X stuff - the first 2 numbers are the width and height of the invisible text window in which to present the message. The other 2 numbers are the x and y coordinates on screen. Note that, as root-tail is essentially just console output, the coordinates are lines rather than pixels! You will have to experiment with this one to fit your needs and screen resolution. Mine is 1366x768. Refer to the man page for more.

-font is obvious. I have chosen an old X font without antialiasing (though I'm not even sure if trutype fonts with smoothing are even supported). This is the standard fixed width font and it works well for me.

The last bit is the log file in question. On Debian, I had to allow read access for /var/log/messages. This log shows events like USB keys being plugged in and such and hence is rather useful.





Fin. 

No comments:

Post a Comment