Showing posts with label IceWM. Show all posts
Showing posts with label IceWM. Show all posts

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.

How to Turn an Older Tablet Notebook Into a Functional Machine: Part 3 Choosing a Window Manager or Desktop

This is part 3 in a series about making some solid use of an older tablet laptop. In part 1 we talked about performing an install over the network and in part 2 we went over configuring wireless and installing some basic packages with a few command line tips for good measure. Now we're going to discuss choosing a window manager or desktop for the system.

Many people will never need a desktop environment. Actually the laptop used for this test went without one for some time after it was setup because I simply had no need to use one. However, as luck would have it some of the programs I wanted to use had to run in x. They were all either IDEs or document viewers for viewing pdf and ps files and there were very few of them. Since only a few programs needed x to run and the laptop isn't exactly top spec I saw no need to go for one of the larger desktop environments like Gnome or KDE. Even Xfce, I decided, was too much when all I wanted to do was run some nicely featured coding environments and view pdf files. The choice was made to use a window manager instead.

A window manager is kind of like a desktop but far more rudimentary. Many of them are still quite capable of looking nice and performing all the tasks you could possibly need them too. They are as a rule harder to configure then the major desktops but more extensible. They are also generally faster and consume less resources, in terms of both memory and storage space.

Choosing a window manager is a very personal choice. Go with whatever works for you and suits your needs. I tried quite a few before I settled on one to use and you probably will too. Check out xwinman.org for a nice site with information and links to various window manager and desktop sites.

The first window manager I tried (from here on noted as simply wm) was Enlightenment. I chose it because I had heard of it. That was my own motivation for using that as a starting point. Suffice to say I did not enjoy it. At all. It did what I needed it to do, I just didn't like the feel.

The next one I tried was Fluxbox. I should mention here that I started with the version from the repository first. Only if I liked it did I then get the most recent version and configure anything. The version of Fluxbox I got from the repository was useless. Literally. Without configuration I was left with a blank blue screen and a task bar with a clock. No key binding, no way to access programs or a terminal, no nothing. I only wanted a wm so I could run the five programs I had that required one. I wasn't looking to spend a ton of time setting up my wm when I was barely going to use it. Fluxbox was off the list.

The third one I tried was Fvwm-Crystal. Here we had a nice little system going on. I decided I liked it enough to download the newest version and patch it and was left with a nice looking functional desktop. It was already set up with a decent configuration and was easy to edit further. This one got to stay on the list but I wasn't done trying things.

The last one I tried was IceWM. The version from the repository was decent enough so I installed the latest over it. Bingo. I was hooked. Configuration was not as simple as for Fvwm-Crystal but it was still quite easy. Notably the key bindings. A simple configuration file allowed me to set a key binding for everything I wanted to use. No need to navigate or even setup the menus. A Ctrl-alt-e and I launch Eclipse. A Ctrl-t and I get a terminal. Ctrl-alt-h launches dhelp to provide me documentation. This was the one. I even took the few minutes to give it a nice looking theme (blue heart) and a decent background image (using habak). I also set up a pair of terminals that stick to the desktop and are completely transparent to let me monitor the system with 'top' or launch any other program I may need without having yet another window on the screen. All said and done IceWM only occupies 3.4% of my memory and .8% of my cpu at the most. Which leaves things running plenty fast.

Fvwm-Crystal would have been a viable option for me as well. I simply found IceWM to be more to my liking. In terms of technical merits I found them to be roughly even. It was mere preference that led to the final decision.

Making sure that your wm launches when you startx is easy enough. Create a file called .xinitd in your home directory and using your favorite editor add the following.

exec icewm

Or whatever the command is for your wm of choice. It is commonly the wm's name but it may be something else so be sure to reference the documentation that came with it. For instance for Fluxbox the command is 'startfluxbox'. Either way be sure that the first word is exec. That's all you need to do.

Now when you boot your computer you will still be dealing with the command line but you can pop open the wm at any time to use those gtk and qt programs you love so much. Many of these wms are highly customizable and will allow you to build more extensive menus in the event that you want to use a desktop more often then not.

And there you have it. We started with a four year old tablet pc that had no operating system, no bootable media, and not much in the way of performance available and gave it a new life as a mobile development platform. Of course it could be used for many other purposes as well. Including just a regular old laptop, but turning it into this was more fun and taught me a lot along the way. Notably in the way of dealing with problems unique to laptops like battery power and unusual hardware.

We've covered network installation, configuring wireless, some basic packages to install, a few command line tips, and choosing a window manager that runs well on the resources available. I hope you took at least as much from this experiment as I did. Soon to come will be a wireless installation attempt and some tips and tricks on configuring IceWM. Until then.