posted by Rahul Gaitonde on Thu 22nd Jul 2004 18:23 UTC

"IceWM, Page 3/6"
3.2. IceWM configuration files

As I mentioned earlier, all of IceWM can be configured via five files. I stress once more that while there are graphical tools to provide an easy, point-and-click interface to configure IceWM, they're ugly, incomplete, immature, hard to get, hard to install, frustrating to use, and hopelessly inadequate. (My, am I in a vicious mood!) Actually, all five files are small in size, well commented, and have trivially simple syntax. Besides, the excellent IceWM Manual contains all you'll ever need to know to build your own config files.

  1. menu (~/.icewm/menu)

    Unlike the Windows/KDE/Gnome "Start Menu"s, IceWM's menu is not a pain to edit. The philosophy is to have entries for only those programs that you use on a regular basis, and organised into the menu structure that you want.

    First, jot down a list of the applications you use on a regular basis, and the path to the executable. If you like, in a text editor or on paper, draw a rough outline of how you'd like your menu to look once its done. This outline will be a huge time saver when you actually to write your own menu file, and you'll be able to concentrate on writing the file itself, rather than designing the menu at the same time. For instance, some part of my menu outline would go like:

    	More (menu)
    	Config Files (menu)

    Now for the file itself. The syntax for the menu file is

    • For applications:
      prog	Program_Name	icon-name	executable -with -options
    • For submenus:
      menu	Submenu_Name	folder {}

    Between the braces, you can have any sort of hierarchy you want - applications, and more submenus. If the program label or submenu label spans multiple words, enclose the string in double quotes. The icon field is the name of the icon file to be used to display a small 16x16 sized icon to the left of the menu entry, a la Win/KDE/GNOME. More on the icon convention after this sub-section. Finally, the "path to executable with options" is how you would call the application via the command-line, with all its options. For instance, the menu entry for my xterm is

    prog XTerm xterm xterm -bg black -fg white -font 7x14 -geometry 120x40

    Hope that example makes things clear. Oh, and one more thing: If IceWM can't find the executable, it just won't display it! If you thought you had Gaim installed but didn't, IceWM won't find /usr/bin/gaim or whatever, so it'll just ignore that line! Nice touch, eh?

    About the icon option:
    IceWM expects to find all its icons in some directory. This option can be set in the preferences file (the exact option will be discussed in the section on the preferences file). If not set, it'll assume the system default. Now, if configured with generic icon handling capabilities, IceWM will look for two .xpm files. For instance, for Mozilla, IceWM will expect to find, in that directory, XPM images named mozilla_16x16.xpm and mozilla_32x32.xpm, which are, of course, 16x16 pixel and 32x32 pixel images. To set this icon in the menu file, simply enter "mozilla" in the icon field. So your entry for mozilla would end up something like

    prog Mozilla mozilla mozilla

    My IceWM installation has the icon directory set as ~/pics/icons . One useful tip: Usually the icons that you want to use will be in PNG format, usually as part of a Gnome or KDE icon theme (think Crystal or Noia). So to convert them to XPM, and the right sizes, you'll need a couple of carefully crafted shell commands:

    1. First copy all the icons you want from the KDE icon theme into a directory - ideally the one which you've chosen as your IceWM icon directory. So you'll have PNGs like mozilla.png, gaim.png.... Ideally copy the 48x48 icons.
    2. Now we need to convert them to XPM format, and resize them to 16x16 pixels and 32x32 pixels. So for that, on the command line, type
      $ for F in `ls *.png`
      > do
      > convert $F -resize 16x16 `basename $F .png`_16x16.xpm
      > convert $F -resize 32x32 `basename $F .png`_32x32.xpm
      > done

    With this, you'll have populated your icon directory.

    Table of contents
    1. "IceWM, Page 1/6"
    2. "IceWM, Page 2/6"
    3. "IceWM, Page 3/6"
    4. "IceWM, Page 4/6"
    5. "IceWM, Page 5/6"
    6. "IceWM, Page 6/6"
e p (0)    68 Comment(s)

Technology White Papers

See More