Customizing the XDM Login Screen
A bitmap can be used to tile (copied over and over to cover the whole display) a simple two-color image onto the background instead of a solid color. There should be a collection of bitmaps in /usr/include/X11/bitmaps. You can also create your own using the bitmap program included with X windows. Try changing the xsetroot line to this:
/usr/X11R6/bin/xsetroot -bitmap\ /usr/include/X11/bitmaps/xsnow
Restart XDM as before, and you should now have a nice winter scene. You can change the foreground and background color with the bitmap by adding the -fg and -bg options and specifying a color. Try changing it to this:
/usr/X11R6/bin/xsetroot -bitmap\ /usr/include/X11/bitmaps/xsnow -fg blue -bg yellowNot the most wonderful colors for snow, but you get the idea. The colors recognized by the -fg and -bg options are the same as the ones in the rgb.txt file discussed above.
You can also tile color bitmaps stored in the xpm format. The xpmroot program is used for this. Change the xsetroot line to something like this:
Now that we can display colors and tiled bitmaps on the background, it is time to display a picture on the background. To do this, I use a shareware graphics program called xv. You can get it from the xv home page at http://www.trilon.com/xv/, or it may be included with your Linux distribution. Remember, this is shareware, and you should support the author by sending him $25 if you find his program useful.
I have chosen to use xv, but any program capable of displaying an image on the background can be used. For xv, you tell it to display the image centered on the background. You also want it to exit immediately after displaying the image; otherwise, XDM will hang until the xv program is exited manually.
/usr/X11R6/bin/xv -root -rmode 5 -quit\ /root/.gromit01.jpg
I use this to put a picture in the center of the display. To view your changes, save the Xsetup file and press <H>ctrl<H>_<H>alt<H>-F7 to switch back to the XDM screen. Press <H>ctrl<H>-<H>alt<H>-<H>backspace<H> to restart the X server. You should now see your image in the center of the screen, covered by the login box. xv supports several other placement options using the -rmode command. You can see a list of these options by typing xv -rmode -1.
With the help of a simple Perl script, you can display a random image on the background each time XDM is run. Listing 1 is a simplified version of a script written by Scott Scriven, email@example.com.
Type in this program or download it from ftp.linuxjournal.com/pub/lj/listings/issue68/3325.tgz. and save it as /usr/local/bin/bkgd. Make sure execute permissions are set by typing:
chmod ugo+x /usr/local/bin/bkgd
You may also have to change the path to xv and find to match your local setup. Including the absolute paths in the script ensures it will work correctly, even when the $PATH environment variable isn't set.
To load a random background, change the xv line in Xsetup to usr/local/bin/bkgd instead. Create a /usr/lib/X11/backgrounds directory and fill it with your favorite images. A couple of good places to look for background images are http://www.digitalblasphemy.com/ and http://ipix.yahoo.com/.
Listing 2 is a working Xsetup file with the intermediate steps commented out with “#” characters.
Now we want to customize the xlogin box using the /usr/lib/X11/xdm/Xresources file. This file is also used for configuring other XDM widgets like the chooser, but we aren't going to deal with these other options here—see the XDM man page to learn about them.
We can move the xlogin box, resize it, change its color, its fonts and what it says. I have moved mine into the lower-right corner and made it as small as I can, so that it doesn't cover up the background image.
The XDM xlogin widget uses X resources to specify these settings. They are all stored in the Xresources file and are read by XDM each time it restarts. A list of the available options, taken from the XDM man page, is shown in “Xresources Options”. I will go through each option and explain its use.
I have ignored several more advanced xlogin resources, some of which may appear in the Xresources file. It is safe to leave them alone—the defaults set when you installed X should work fine. The XDM man page contains full descriptions of each option, if you want to experiment with them.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Astronomy for KDE
- Profiles and RC Files
- What's Our Next Fight?
- Understanding Ceph and Its Place in the Market
- Snappy Moves to New Platforms
- Maru OS Brings Debian to Your Phone
- OpenSwitch Finds a New Home
- Git 2.9 Released
- Mark Geddes' Arduino Project Handbook (No Starch Press)
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide