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.
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.