Copyright (C) 2003–2007 Juhapekka Tolvanen and Mika Jorma Saaristo
This script was originally created as a Bourne Shell script by:
Mika Jorma Saaristo
http://www.cc.jyu.fi/~mjsaaris/
mjsaaris (at) cc (dot) jyu (dot) fi
After that it was heavily modified by:
Juhapekka ”naula” Tolvanen
juhtolv (at) iki (dot) fi
A function called ”watcher” is based on a Perl-code-snippet as seen in a man page of xscreensaver-command (by Jamie Zawinski ( http://www.jwz.org/ ))
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also this documentation-file is under GNU GPL version 2 or (at your option) any later version. Source code is file README.txt and everything that is generated from it is treated like binary of software.
Main advantage of this software is extreme flexibility. Practically any command that can change your desktop wallpaper can be used by this software. This software tries to avoid loading wallpaper when XScreenSaver is running some of its screen hacks. You do not need Mad Shell-Fu Skillz for configuring this software.
If you do not want to change desktop wallpaper automatically after every few hours, this software is definitely not for you. If you want to change your desktop wallpaper after every few hours, but do not need all this flexibility, this software may be a little bit overkill for you. Some Bourne Shell -scripting skills are needed when configuring this software and for some people it is too much (but as I said before, you do not need Mad Shell-Fu Skillz)
In my machine a command called ps is from software package called procps. If you use some GNU/Linux-distribution, you probably have it. I have not tested, how well these scripts work with other implementations of ps-command.
tausta.sh script is not as reliable as tausta.ksh.sh : I have seen many times, that tausta.sh scripts loads wallpaper when xscreensaver runs some screen hack. If you experience same problem, install some implementation of Korn Shell -language (ie. pdksh, mksh or zsh) and use tausta.ksh.sh instead.
Most proprietary Unixes has at least AT&T ksh88. Some of them has dtksh; It is ksh93 with CDE-capabilities. pdksh has tinier binary than zsh, so you'd better use it as implementation of Korn Shell-language. If you use zsh as Korn Shell-implamentation, you must make it emulate ksh with this command:
emulate ksh
The Original AT&T KSH93 is finally really free software, so feel free to use it:
http://www.kornshell.com/
At least Debian GNU/Linux and Slackware Linux have it packaged already.
First you need some cool software, that can load wallpaper or image to X Window System desktop. I prefer xli and hsetroot. If I want to download some frequently updated image from WWW and load it as wallpaper, I prefer dog for that purpose, but curl is also good.
Create directory ~/.tausta.sh.dir . tausta.rc.sh has some user-serviceable parts you can edit; at least name of window manager process must be right or script won't run at all. Put tausta.rc.sh to ~/.tausta.sh.dir/ . Put scripts tausta.sh and tausta.ksh.sh to some directory in your $PATH , for example ~/bin/ . You may need to edit them a little bit, first. Use chmod-command to ensure that you can run them.
Now create some file called tausta.conf and put it to ~/tausta.sh.dir . A file called tausta.conf is provided as example. Empty lines and lines starting with # are ignored, of course. Commands are normal commands that Bourne Shell or any of its derivative understands. You can use exported environment variables instead of plain commands and directory paths. Those environment variables are exported in file ~/tausta.sh.dir/tausta.rc.sh .
You can unsort lines of tausta.conf with software like rl , unsort or bogosort.
Now everything should be in place. Then you must configure your X-session, windowmanager or desktop environment so, that command like this is run automatically during startup:
nice -n 20 tausta.ksh.sh &
If your computer is powerfull enough, you can omit that nice -n 20, of course.
You can stop waiting for next loading of wallpaper with commands like these:
kill -USR1 $(cat ~/.tausta.sh.dir/tausta.pid)
kill -USR1 `cat ~/.tausta.sh.dir/tausta.pid`
Feel free to bind them to some menu entry, panel button, keybinding etc. After giving such command, you must wait about amount of $CHECKINTERVAL seconds before the next wallpaper is loaded.
Use signal like 1, 2, 3, 15 or 20 (SIGHUP, SIGINT, SIGQUIT, SIGTERM or SIGCHLD) to stop script, so it can safely exit. You can restart script with signal USR2 .
If some image loading command makes your desktop background messed up, or any other anomalies are seen, then check out file ~/.tausta.sh.dir/lastcommand to find out which command was tried when loading the latest image.
Consult these, if you can't find some software:
You'd better learn this feature of your text editor: How to pipe chosen lines of text to external command and then substitute those lines with output of that command. If your text editor can’t do it, it's time to learn some better text editor, like vi, Vim, GNU Emacs, XEmacs or SXEmacs. Learn to use ”undo”, too.
Especially I tell you how to substitute xv-commands with free software.
xv -smooth +noresetroot -root -quit /usr/local/textures/3com01.jpg
xli -quiet -cdither -onroot /usr/local/textures/3com01.jpg
xv -smooth +noresetroot -root -rmode 4 -quit \ /usr/local/textures/applix01.jpg
hsetroot -tile /usr/local/textures/applix01.jpg chbg -mode centertile /usr/local/textures/applix01.jpg
xv -smooth +noresetroot -root -rmode 5 -quit \ /usr/local/textures/stickdeath01.jpg
xli -quiet -cdither -onroot -center -border black \ /usr/local/textures/stickdeath01.jpg
hsetroot -center /usr/local/textures/stickdeath01.jpg
Stretch image to fill whole screen:
xv -smooth +noresetroot -root -max -quit \ /usr/local/textures/soundbla.jpg
hsetroot -fill /usr/local/textures/soundbla.jpg
Stretch image, but keep aspect ratio:
xli -quiet -cdither -onroot -fullscreen -border black \ -smooth /usr/local/textures/soundbla.jpg
hsetroot -full /usr/local/textures/soundbla.jpg
(Don't blame me, if such image is one day replaced with goatse or tubgirl or if some goatse-like guy starts doing his thing in front of some webcam…) dog can not handle redirection. hsetroot can not read from stdin.
dog --no-header http://vision.ucsd.edu/~atai/softwarewar.png \ | xsetbg -quiet -onroot -center stdin
dog --no-header http://www.ssec.wisc.edu/data/comp/latest_moll.gif \ | xsetbg -quiet -onroot -fullscreen stdin
dog --no-header http://www.ssec.wisc.edu/data/comp/latest_moll.gif \ | xli -quiet -cdither -onroot -fullscreen -border black -smooth \ stdin
wget -q -O - http://vision.ucsd.edu/~atai/softwarewar.png \ | xsetbg -quiet -onroot -center stdin
curl -s http://vision.ucsd.edu/~atai/softwarewar.png \ | xsetbg -quiet -onroot stdin
lynx --source --dump http://vision.ucsd.edu/~atai/softwarewar.png \ | xsetbg -quiet -onroot -center stdin
elinks -dump -source http://iki.fi/juhtolv/pix/ryppy_black.jpg \ | xsetbg -quiet -onroot stdin
w3m -dump_source http://iki.fi/juhtolv/pix/ryppy.jpg \ | xsetbg -quiet -onroot stdin
xphoon
xplanet -config ~/.xplanet/config -longitude 25.5 -latitude \ 62.1 -label -num_times 1 -label_string "Origin: %o. Target: %t." \ -labelpos "+15+15" -pango -font 'Sans' -fontsize 12
xplanet -config ~/.xplanet/config -longitude 25.5 -label \ -num_times 1 -label_string "Origin: %o. Target: %t." \ -labelpos "+15+15" -pango -font 'Sans' -fontsize 12 -projection \ mercator
xplanet -config ~/.xplanet/config -longitude 25.5 -label \ -num_times 1 -label_string "Origin: %o. Target: %t." -labelpos \ "+15+15" -pango -font 'Sans' -fontsize 12 -projection lambert
xplanet -config ~/.xplanet/config -latitude 90 -label \ -num_times 1 -label_string "Origin: %o. Target: %t." -labelpos \ "+15+15" -pango -font 'Sans' -fontsize 12 -projection azimuthal
xplanet -config ~/.xplanet/config -latitude -90 -label -num_times \ 1 -label_string "Origin: %o. Target: %t." -labelpos "+15+15" \ -pango -font 'Sans' -fontsize 12 -projection azimuthal
xplanet -config ~/.xplanet/config -longitude 25.5 -label \ -num_times 1 -label_string "Origin: %o. Target: %t." -labelpos \ "+15+15" -pango -font 'Sans' -fontsize 12 -projection ancient
xplanet -config ~/.xplanet/config -longitude 25.5 -label \ -num_times 1 -label_string "Origin: %o. Target: %t." -labelpos \ "+15+15" -pango -font 'Sans' -fontsize 12 -projection hemisphere
xplanet -config ~/.xplanet/config -longitude 25.5 -latitude \ 62.1 -label -num_times 1 -label_string "Origin: %o. Target: %t." \ -labelpos "+15+15" -pango -font 'Sans' -fontsize 12 -projection \ orthographic
xstarfish --size random
xstarfish --size small
xstarfish --size medium
xstarfish --size large
xstarfish --size full
Set background image:
gconftool --type string --set \ /desktop/gnome/background/picture_filename \ /path/to/filename
Image options (yes, separated command):
# Fill screen. Keep aspect ratio (in Gnome 2.16): gconftool --type string --set \ /desktop/gnome/background/picture_options scaled
As I am writing this that part picture_options can have one of these values:
You can check out which image options are available by doing this: Start up gconf-editor. See gconf-option /desktop/gnome/background/ .