Back in February I wrote about using xli to add a desktop background of your choice to a minimalist window manager. I chose to write about xli for two reasons. First, several window manager developers choose to use xli by default. For example, if you look at a .jwmrc file, the configuration file used by JWM, a lightweight window manager I am rather fond of, you will see that xli is used in the <Startup Command> section. The second and perhaps more important reason I chose to write about xli is because it’s what I knew and used for years. One thing about Linux and UNIX: there are always different ways to do things. It turns out that many distros include something a bit newer and perhaps better than xli.
Esetroot can also be used to change the contents of the root window in X. The root window is your desktop background. The advantage of Esetroot over xli is that it supports transparency in applications. This is a low resource piece of eye candy that I particularly like in terminal emulators like mrxvt, aterm, and xfce Terminal. I like seeing my background, albeit shaded, perhaps in a color of my choice, in the background of my terminal window. pypanel, a small panel or toolbar application for minimalist window managers written in Python, also supports transparency nicely.
The command:
Esetroot -fit /usr/share/wallpapers/iceberg.jpg
gives me a desktop background photo of icebergs at sea that fits my entire screen. This is functionally equivalent to:
xli -onroot -fullscreen /usr/share/wallpapers/iceberg.jpg
in terms of setting a background. Either command can be used at the command line for the current session or placed in an appropriate configuration file to run when your window manager is started.
I could conceivably use the sample Esetroot command above in place of xli in my ~/.jwmrc file. If you use PekWM you can add it to your ~/.pekwm/start file, replacing iceberg.jpg with your favorite background, and voila, a nice background every time the normally minimalist PekWM starts. If your favorite little window manager doesn’t have it’s own configuration file this command could also be added to your .xinitrc file.
There’s nothing wrong with xli. If your favorite distro includes an xli package but not an Esetroot package and you don’t feel like compiling from source then xli is probably your best choice. If you don’t particularly care about transparency support then either command is equally good.


Check out hsetroot; it doesn’t come as an appendix to a much larger package (ie. Eterm) and has a bunch of options above and beyond Esetroot.
A Tool I use in openbox on Foresight Linux is Nitrogen. Using Nitrogen, you can browse your desktop backgrounds and select it similar to the default wallpaper browser in Gnome. It's much more intuitive than eseroot and feh which are the two most often used.
Using the line "nitrogen --restore &" to my autostart.sh file which openbox uses during startup will allow the app to run each time I login and it will restore the last selected wallpaper.
Please check out Nitrogen...you honestly don't have to do anything other than that one command and everything else is point click.
I'd been using a manually built standalone Esetroot for its png support. I'll try xli and hsetroot -- thanks for the tips.
@Aristotle: As Zed pointed out many (most?) distributions package Esetroot standalone. I don't have Eterm installed anywhere at the moment but I do have Esetroot installed everywhere. I should also point out that Esetroot is a dependency for most fluxbox packages as the fluxbox developers chose to use Esetroot as their default.
@Aristotle & devnet: I will certainly check out hsetroot and Nitrogen. As I said in the article there are many ways to achieve things in Linux/UNIX and I am always willing to try something new and see if someone truly has a better mousetrap :)
Keep the comments coming. They've been great and informative so far.
I took a look at the hsetroot web page. Functionally it is very similar to Esetroot. It seems to me using either Esetroot or hsetroot would be equally good. My distros of choice package Esetroot but not hsetroot so it's an easy choice for me.
My favorite, which also supports transparency, is chbg. It also allows you to set up a list of images to cycle through on the root window.
Sometimes, I use them in combination. Set one image with chbg, then change the root with xli or xsetroot (color only, no image). This gives me a phantom image in my transparent terminals, different from my background.