First you must enable 24-bit support on your X server (Run xdpyinfo first to make sure your server supports this visual). This is important even when dealing with 256 color backgrounds as the default IRIX palette is not dynamic. Edit /var/X11/xdm/Xservers to reflect the following (make certain to back up your existing file first in case you need to revert):
:0 secure /usr/bin/X11/X -bs -nobitscale -c -pseudomap 4sight -solidroot sgilightblue -cursorFG red -cursorBG white -class TrueColor -depth 24
The key section is the -class TrueColor -depth 24 entry; simply adding this bit to your existing Xservers configuration is sufficient. You'll need to restart your X server to complete the change.
Next obtain some backgrounds; depending on your display configuration most likely 1280x1024 or 1024x768 8-bit X11 PixMap (XPM) format. You can convert JPEG images to XPM using ImageView, xv, NetPBM or similar, and resizing/cropping to the correct size and aspect can be accomplished with an image editor (such as GIMP or Photoshop).
Once you have a suitable XPM file you'll need to configure 4Dwm to use it as a background. First, create and edit a .backgrounds file by copying the system.backgrounds file from /usr/lib/X11 to your home directory as .backgrounds:
cp /usr/lib/X11/system.backgrounds ~/.backgrounds
Using a text editor, add additional entries for your new backgrounds file like this:
command "-xpm /usr/people/neko/backgrounds/anime.xpm"
default "-xpm /usr/people/neko/backgrounds/anime.xpm"
Change the three path entries /usr/people/neko/backgrounds/anime.xpm to reflect the full name and path of the background file you are using. Also be sure to change the background name from "Anime" to whatever you'd like to show up in your Background control panel. You can add several entries like the above to easily switch between multiple backgrounds; I have at least twenty myself.
Once all this has been accomplished you can select your new background(s) from Toolchest -> Desktop -> Customize -> Background. In addition to the increased performance, you'll even get a snippet of the new background in your Desks Overview which is another benefit of using XPM files.
If you'd rather use 24-bit images for your background, you can do so using either xli or Esetroot. xli is part of the xli.1.16 X11 image loader/viewer package on SGI Freeware:
Esetroot is part of the Eterm-0.8.10 Enlightenment-aware xterm package on SGI Freeware:
Example xli entry:
� � command "-execute /usr/freeware/bin/xli -onroot -fork /usr/people/neko/backgrounds/anime2.jpg"
� � default "-execute /usr/freeware/bin/xli -onroot -fork /usr/people/neko/backgrounds/anime2.jpg"
� � exeok "/usr/freeware/bin/xli"
� � readok "/usr/people/neko/backgrounds/anime2.jpg
Example Esetroot entry:
� �command "-execute /usr/freeware/bin/Esetroot /usr/people/neko/backgrounds/anime3.jpg"
� �default "-execute /usr/freeware/bin/Esetroot /usr/people/neko/backgrounds/anime3.jpg"
� �execok "/usr/freeware/bin/Esetroot"
� �readok "/usr/people/neko/backgrounds/anime3.jpg"
xli is the easiest of the two to install as it has no additional dependencies. It's rather dated in that it does not support progressive JPEG or PNG so some backgrounds will need to be converted to standard JFIF JPEG before xli can deal with them. xli also does not support pseudo transparency effects with some applications, a good example being X-Chat.
Esetroot supports progressive JPEG and pseudo transparency in X-Chat and seems a bit faster overall. The downside for those tight on disk space is that it requires 62 additional dependent packages to install.
There are a couple of caveats to note when using 24-bit images. Desks Overview will not display background previews in the desk panes and you'll find that desktop switching slows down dramatically, though that's less of an issue on newer hardware. If you are not a multi-desktop user these issues may not be important to you, but I recommend trying both xpm and the alternate methods given above to see which works best in your environment.