IceWM

From LQWiki
Jump to navigation Jump to search

General

IceWM is a fast, lightweight window manager capable of emulating the look and feel of many other GUIs or of attaining a look all its own.

Ice provides a toolbar with an application menu, region of application buttons, window buttons, system tray area, system monitors, and clock. It is similar to the Windows/KDE/Gnome/etc toolbars. Conversely, the entire menu or parts of it may be disabled. It provides sophisticated windowing controls, a host of right click menus (including a desktop menu identical to the toolbar's menu) and several ways to manage multiple windows and desktops. And all in a handful of executables and a few plain-text configuration files.

Eye candy is not the primary focus, but it can be 'prettier' than some give it credit for. More important than that, it is very usable, configurable, and stable.

Install

Download

Perhaps the best place to go to download is Sourceforge as the Ice page is a bit out of date and even Freshmeat offers 1.2.11 - though both link to CVS. The latest regular release (at the time of this writing) actually seems to be 1.2.14pre9.

Compile

tar xzf ice<tab>
cd ice<tab>
./configure --help
[Check out your options; pick what you'd like - nothing special is really required.]
./configure
make
su
checkinstall
[or 'make install' if you don't have checkinstall]

Configure

Default Files

If you start bare, ~/.icewm/ and ~/.icewm/theme are generated, but see below for the 'startup' file and what can be pulled from the system-wide configs.

If you installed to /usr/local, then /usr/local/share/icewm/ will contain something like the directories:

icons
ledclock
mailbox
taskbar
themes

and the files:

keys
menu
preferences
toolbar
winoptions

Copy over whatever you'd like to modify to ~/.icewm.

For example, my ~/.icewm contains the directory

themes

(And I then renamed the system themes directory to 'not.themes' because I didn't feel like either deleting those themes - useful reference - or having them appear in my themes menu. I'm the only user on my system so I can do stuff like that. :) )

and the files:

keys
menu
preferences
*prefoverride
*startup
*theme
toolbar
winoptions

* These are not in the system-wide directory - the first two are created manually and the last is generated automatically.


Custom Files

startup

'startup' is a file that can be used by ice but doesn't have to exist and isn't automatically created. It is read only if ice is invoked as 'icewm-session'.

The ice documentation provides some suggestions and your startup method would vary upon your distro and configuration. For Slackware in runlevel 3 using 'startx', for instance, I wanted a clean, simple startup. I have a poor man's replacement for xwmconfig and run that script to produce my ~/.xinitrc which is a symlink to ~/.xinit/xinitrc.ice which, other than the default file variables, says only:

# Declare what we're starting:
export JWM=ice
[not an ice thing - just a variable for use in some scripts]
# Start the window manager:
exec icewm-session

and icewm-session reads ~/.icewm/startup which is only

#!/bin/bash

gkrellm --geometry +955+0 &
aterm -name jterm &

Thus, as part of 'ps xo command' reports, this is what's started at invocation.

/bin/sh /usr/X11R6/bin/startx -- -nolisten tcp
xinit /home/j/.xinitrc -- /usr/X11R6/bin/X -nolisten tcp
icewm-session
icewmbg
icewm --restart
icewmtray
gkrellm --geometry +955+0
aterm -name jterm
bash

(Well, except the '--restart' part, I think. Ice reads menu changes on the fly but other changes require a restart - oddly, even changing the path on the menu seems to result in ice trying to start the old one unless it's restarted.)

This way, ice takes care of its own background and tray processes.

themes (directory)

This is where to untar any personal themes you add to ice. These themes can be used out of the box by selecting them from the menu (where they automatically appear) or they can be modified by editing the name-of-theme.theme file - and the pixmaps, too, if you have graphics talent.

I initially tried an old version of ice and didn't like it. It was only recently, playing around with Gentoo, that I tried it again (pre7) and converted. But when I got back to Slack and tried to install it there (pre9), I had one particular problem, in that the themes' fonts didn't work. In my install, all themes contained things like:

TitleFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
MenuFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
MinimizedWindowFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
ActiveButtonFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
NormalButtonFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
QuickSwitchFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
ListBoxFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
StatusFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
ToolTipFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
ActiveTaskBarFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
NormalTaskBarFontName = "-artwiz-snap-regular-r-normal-sans-10-*-*-*-*-*-*-*"
ClockFontName = "-b&h-lucida-bold-r-normal-sans-14-*-*-*-*-*-*-*"
ApmFontName = "-b&h-lucida-bold-r-normal-sans-14-*-*-*-*-*-*-*"

But only 'default' also contained

# Font Specification
TitleFontNameXft = "Snap:size=10"
MenuFontNameXft = "Snap:size=10"
MinimizedWindowFontNameXft = "Snap:size=10"
ActiveButtonFontNameXft = "Snap:size=10"
NormalButtonFontNameXft = "Snap:size=10"
QuickSwitchFontNameXft = "Snap:size=10"
ListBoxFontNameXft = "Snap:size=10"
StatusFontNameXft = "Snap:size=10"
ToolTipFontNameXft = "Snap:size=10"
ActiveTaskBarFontNameXft = "Snap:size=10"
NormalTaskBarFontNameXft = "Snap:size=10"
ClockFontNameXft = "lucida:size=14:bold"
ApmFontNameXft = "lucida:size=14:bold"

Copying that last section to all theme files made the fonts work. (Or recompiling and changing a lot of settings and monkeying around generally did, but I think it was just that section.) In looking over the change file, I came across this:

1.2.14pre8: 2003-01-11
add Xft font specification for Infadel2 theme

and this:

all font preferences now have a ...Xft variant
that can be set to fontconfig pattern specification.
example: MenuFontNameXft=sans-serif:size=12:bold

Something may have gotten confused between pre7,8,9.

TODO: more on the theme file itself

menu

You can modify IceWM to your hearts content....use IceMC 'icemc" should be installed with K12LTSP. Disregard the first error message and navigate to /usr/share/icewm and edit the menu file.

This governs the contents of the pop-up application launcher.

The basic syntax is

entry-type menu-name menu-icon command-line
or
menufile menu-name menu-icon menu-file

For instance

prog "ATerm 0.4.2" terminal3_16x16 aterm

'prog', 'menu', 'menufile', and 'separator' are the only types I know of. Quotes are optional unless there are spaces (or possibly other special marks) in a field. See 'preferences' about icons, icon paths, and naming conventions.

Separators are created simply with

separator

For subsections in your menu, there are two different approaches: 'menu' can basically have 'include' directives - for instance:

menufile Programs folder programs

works like 'include programs' if you have a file called 'programs' with more entries in it. Another way is in the main menu file, but by declaring the type as 'menu' and surrounding the block with braces like so:

menu "Editors" folder {
prog "NEdit 5.4rc2" nedit /home/j/bin/nedit
prog "GVim 6.2" gvim gvim
}

(Ice seems to have trouble with tilde expansion in the menus, so I write out the full paths.)

toolbar

This governs the contents of the 'one-click' application section of the toolbar.

According to ice logic, it's actually just another one of those submenu files that happens to show up on the toolbar as well. However, I removed it from the menu (pointless redundancy) and only have them appear on the toolbar - specifically in what Win98 (etc) would call the 'quicklaunch' area, and that's really what the file is - a definition of the apps that appear in that area - it doesn't configure the whole toolbar.

keys

This defines your keyboard accelerators.


This section digresses a bit from ice in part, but relates and may be useful (or wrong and harmful - reader beware).

If you have a special key that's not really doing anything, type xev and then hit the key you're interested in. Look for the keycode (such as 222) in the output. Look through /usr/X11R6/lib/X11/XKeysymDB especially, or maybe also /usr/include/X11/XF86keysym.h or /usr/include/X11/keysym.h or /usr/include/X11/keysymdef.h (or whatever - and /usr/include is a symlink to /usr/X11R6/include on my box) and find a keysym such as 'XF86PowerOff'. Now that you've pulled out xev and some files, pull out xmodmap and issue

xmodmap -e "keycode 222 = XF86PowerOff"

(The quotes are vital to parse the lines correctly and the *precise* keysymname - I got confused because the files differ and I'd picked up XF86_PowerOff and XF86poweroff and so on from other files.) Then that key should be identified.

If it works, you can add it to ~/.Xmodmap. Mine has

keycode 117 = XF86MenuKB
keycode 222 = XF86PowerOff
keycode 223 = XF86Sleep
keycode 227 = XF86WakeUp

Then, since you're doing this for ice, you can then edit the keys file to say

key "XF86PowerOff" killall -QUIT icewm

and hitting that button will then perform that action.

The following lines

key "Alt+Ctrl+KP_Divide" aumix -v -5 # lower volume
key "Alt+Ctrl+KP_Multiply" aumix -v +5 # raise volume

were in the original file and didn't work for some reason. (Possibly a number lock issue, but I think I tried that.) And no variations I attempted with, say, rexima, worked either. But going through the above process and putting the following did and gave those keys, that I didn't use, something to do.

key "XF86Sleep" aumix -v -5
key "XF86WakeUp" aumix -v +5

Another example is

key "Super+Print" /home/j/sbin/xgrabroot

This illustrates that your Mod4, Windows, AltAlt, Super, Whatever key is called 'Super' by ice and that things like the 'print screen' key can be incorporated.

winoptions

This tells ice specifically how to handle the windowing and other aspects of selected applications.


Something useful for setting winoptions is to know what the windows are called. As something portable between GUIs, creating an executable file with

#!/bin/bash

xprop | grep WM_CLASS | xmessage -file - -center

and adding the name of the file to the menu, rather than locking it directly in a menu or an often inaccessible bash alias is helpful. Then you can just click on the menu and then click on the app and get a report. Not all apps set this value, but they should. And some set transitory windows to the same value, which they shouldn't. But it is still usually useful.

Specifying icons for the menu is handled in the menu file. To specify them elsewhere (title-bar-buttons, windowlist, system menu, systray, etc.), use winoptions. If the icon file is in ice's search path (defined in 'preferences') and is an xpm, just specifying the name will do. If it's a png or other format, specify name.png (or the image's extension, in other words). I believe ice requires imlib to handle anything other than xpm's. If it's not on the path, move it or specify the full path. Many applications specify their own icons, but those can be overridden. (A tip for snagging icons: some apps compile in an icon but place the independent file nowhere on the system. Poke around in the source code and it'll be there.)

Ice can handle certain genuine 'systray-capable' apps such as gaim but it just takes a trio of lines to make a 'systray-like' app. Then it just takes another line to position the app and another to specify its icon. There are a host of other options, though. As an example, gkrellm:

gkrellm.Gkrellm.icon: gkrellm
gkrellm.Gkrellm.geometry: +956+0
gkrellm.Gkrellm.tray: Exclusive
gkrellm.Gkrellm.allWorkspaces: 1
gkrellm.Gkrellm.ignoreQuickSwitch: 1

(I include a massive digression on Aterm in Ice but only as a separate page because it's really silly.)

preferences

The master file of ice's look and feel.

I don't use a menu much but, when I do, setting 'MenuMouseTracking=1' is a huge plus. If you hate the application icon over your windowing buttons like I do, 'ShowMenuButtonIcon=0' is the thing.

TODO: make this a real section

prefoverride

AKA !important preferences.

To generate a quick version of this file, maybe

sed -e 's/^[ ]$//g' preferences | grep -v '^$' | grep -v '^#' > prefoverride

would do. I did something similar but can't remember what. Be warned that the prefoverride file is for just that: overriding anything, such as a theme, that specifies something that would override 'preferences'. But if you didn't want those preferences, you wouldn't have changed the defaults in the first place, right? The order of priority is prefoverride, theme, preferences. So if something is vital to you, this is the place to make sure nothing messes with it. But if you don't wish to override a theme, don't include it here.

theme

Lastly, the 'theme' file is generated by ice for its internal use and specifies the theme in use and a history of past themes used.

Notes

I had a hideous time with inconsistent and unappealing fonts and my notes make no sense. I believe I ended up deleting the Infadel theme's icons and adding

# change to less obtrusive cursor images
Xcursor.theme: whiteglass

to ~/.Xresources. Still not perfect, but better to me.

At one time I substituted dillo for ice's documentation viewer because the viewer was almost unusable, but it has been much improved. The changelog notes:

- improvements to icehelp

However, Ice wanted the help file to be in /usr/local/share/doc/icewm-1.2.14pre9/, yet didn't create it. Maybe I did something wrong. However, I had my old docs and ice's docs are mostly out of date anyhow :), so I su'ed and moved my old /usr/local/share/icewm/doc/ directory to that location and access them as normal.