Sunday, September 7, 2008

Configuring IceWM: Basics

When I started using IceWM I found little in the way of straight forward tutorials for configuring it. The documentation available from the website is suitable for most cases but certainly lacking in some regards. So I'm going to present some tips on configuring this handy window manager as easily as possible.

First things first. I would recommend against using IceConf. This program is a gui that gives you some options and will automatically generate config files for you. I advise against it because the options it lists are not comprehensive, not very well explained and the files it generates may leave off certain features enabled by default that you may wish to keep but not know how to implement yourself. Foremost of which is the right-click menu. This menu goes away after using IceConf and when I started tweaking and configuring my window manager I didn't know how to get it back. Nor was the preferences file generated by the program commented well enough to let me know what I needed to change to fix it.

Now that that's out of the way let's get started. These directions are for Debian based systems and file paths as well as some commands may be different on other distributions. First make a new directory in your home folder called '.icewm'. Now copy the contents of '/usr/share/icewm/' into the new directory '.icewm'. These are the default config files for the window manager. Editing the ones in your home folder not only means that you will have backups and that on a multi-user station you won't be messing with other people's settings. At some point you may want to add a file called 'startup' but we'll get to that later.

The first file you probably want to edit is called 'preferences'. It can be easily modified using your favorite text editor by simply uncommenting and/or changing the boolean operator of a given function. The file is well commented and functions are well explained in most cases. If you don't know and can't figure out what something does you have two choices. To be on the safe side don't touch it and assume it doesn't matter much anyways or if your willing to take a bit of a risk mess with it and see what happens. I strongly encourage the latter. After all you can always change it back and you have backups handy just in case, may as well have some fun. Besides almost all of the options in the file have to do with things like color, size and style. It's doubtful that you're going to break anything by changing these values.

The next file is called 'keys'. This allows you to change the key bindings within the environment. Again it's pretty self explanatory. Modifiers available include Alt, Ctrl, Shift, Meta, Super, and Hyper. To add a key binding on a new line type

key "$key1+$key2+key3.." $command

where $key(n) are the keys to use for the bindings and $command is the command with options to execute. The keys to use must be surrounded by double quotes. The command should not be quoted. I find this to be the most useful section to configure. Since I have IceWM on a laptop and the mouse is awful this allows me to bypass using it completely if I so choose (and I do, because I hate the built in mouse on laptops, all of them)

The last file you're most likely going to want to edit is called 'menu'. This file controls what is displayed in your start menu. This is also pretty darn easy to edit. Notice a theme here? It's really quite simple to make tons of changes. To add a program to the menu find the section you would like it to go under and on a new line but staying inside the {} brackets type:

prog "$Name" $Icon $Command

where $Name is the name you would like to appear in the menu, $Icon is the path to the icon to be used (or in in lieu of using an icon type '-' without the quotes of course) and $Command is the command with options to execute. To add a menu or sub menu type:

menu "$Name" folder {
$prog1 line
$prog2 line
$prog(n) line

where $Name is the name of the menu and $prog(1, 2, n) are the lines for the programs you would like to appear in that menu as described above. Menus can be nested inside other menus too. Anything that appears within the {} brackets of a menu will appear under that menu and that goes for separate menus as well. Here's an example taken from my menu file:

menu "Development" folder {
menu "Math and Science" folder {
prog "Octave" octave octave-2.9.12
prog "Maxima" maxima maxima
prog "R" R R
prog "SciLab" scilab scilab
menu "IDEs" folder {
prog "Geany" geany geany
prog "Eclipse" eclipse eclipse
menu "Help and Documentation" folder {
prog "DHelp" dhelp dhelp
prog "DWWW" dwww dwww

If you can't tell from the example this creates a menu called 'Development' that then has three submenus; 'Math and Science', 'IDEs' and 'Help and Documentation'. The quotes around the names of the programs and menus are not strictly necessary unless there is a space in the name. They are included for consistency.

The last file I'm going to cover here is called 'toolbar'. It is edited in the exact same way as the 'menu'. The difference here is that changes applied to this file appear on the toolbar itself rather than in the menu.

Well that wraps it up for today. At some point I'll cover some more advanced configuration methods for IceWM including using the startup file and building themes. Until then.

No comments: