IceWM with Sound

By Ed Hurst | Posted at 11:30 PM
In previous articles, I've focused on helping users of older hardware get the most from it. While most of the FOSS world uses one of the two major desktop interfaces -- KDE or Gnome -- there are plenty of folks using interfaces that are less resource hungry. While it's important to note here that hogging resources is what one pays for all the nifty automatic features found in KDE or Gnome, in reality there are few other compelling reasons to use either. While XFce is a much lighter competitor for them, the latest version (4.x) disappoints me with its lack of a sound module.

If you have a sound card and speakers, there's no reason to neglect that fuller experience that comes from a GUI that provides auditory cues for various events. My real favorite desktop/window manager is IceWM. If you've tried it, you already know whether you like it or not. One complaint I've often heard about it is that setting up the sounds associated with GUI events is really difficult. In fact, many people aren't even aware that sound is possible with IceWM. Some distributions of Open Source OSs are notorious for excluding the sound module by default.

It's possible I've missed something, but so far I've never seen instructions on this posted anywhere. In the past, my queries of the good people maintaining IceWM, as well as postings on the various forums devoted to its use, have brought a deafening silence on the topic. There are a couple of utilities to help set up sound for IceWM, but I've never gotten either of them to work on any system so far. As a non-coder, I'll be glad to admit it's probably my fault. Still, I was undeterred by this and kept searching. It's only by accident I pieced together how to get sound in IceWM.

First, about the only way you can have sound is to have compiled in the ESound interface. If your distro offers an "icewm-gnome" package, there's a good chance this has been done for you. If not, you'll have to compile it in as an option yourself. I've read discussions in the past how the authors had considered working in an Alsa interface, but at that point it was too big a chore, and they had other problems that took priority.

Compiling from source isn't so difficult as it might seem. It took about 5 minutes for me to download the 820KB for the current stable release (1.2.13) over my glacially slow dialup connection, so it shouldn't be too painful for most. I won't be giving detailed instructions on compiling, but simply outline what's required. You'll need to insure your system has the development libraries for whatever version of Gcc/Egc you are using, of course, but a few others as well:

  • Xlibs
  • imlib and imlib-config
  • png, jpeg, mng, and other graphics libs
  • gtk or gtk2

and optionally some of the Gnome development packages if Gnome is installed on your system. Since each distro tends to package Gnome differently, it would be hard to specify them. When you run the configuration script for IceWM, it will complain about what's missing. Be sure to read the INSTALLATION file at the top of the source tree for detailed instructions. When you run the configuration script, you will have to include options for "guievents" and insure that you list ESD as an option for the Icesound interface. Running ./configure --help will show you the options in good detail.

Now there are plenty of other ways to do this, but the above is likely to cover most Open Source systems. I've never gotten sound to work in IceWM without using the ESound server.

Next, you'll need to get your hands on some sounds. At one time a couple of years ago, I knew where to get specific sound theme sets for IceWM, but haven't been able to relocate them. It was in those tarballs that I discovered what names the files had to have:

  • launchApp.wav
  • restart.wav
  • shutdown.wav
  • startup.wav
  • windowClose.wav
  • windowOpen.wav
  • windowMax.wav
  • windowMin.wav
  • windowRolldown.wav
  • windowRollup.wav
  • workspaceChange.wav

It won't matter much if you don't have an official sound theme, just gather some WAV files that suit you and name them appropriately for the action indicated by the name.

Where to put them? In your home directory, as a folder in the IceWM config folder:

 ~/.icewm/sounds/

You can load them from the command line, once you have started IceWM and have the ESound server running (try esd & on the command line). Now, I'm not smart enough to make all this work properly by starting automatically when I login and run IceWM. I've tried creating an .xinitrc with all the various startup commands I like, but it's never worked for me. I simply make a command line script, and once IceWM is running, run the script to set the mouse speed, start the screensaver and ESound, load the sound events, and start the background server (recently made a separate function for IceWM):

   #!/bin/bash
   esd &
   xset m 4 2
   xscreensaver &
   icewmbg &
 icesound --interface=ESD --sample-dir=~/.icewm/sounds &

I name this script Iceup and put it in my ~/bin directory. While there are abbreviations for the Icesound options, at least once I've compiled IceWM and only spelling them out in full would work. You can learn more by typing in a terminal window:

   icesound --help

It works as you might expect with most Open Source commands. Most everything else you might want to do with IceWM is pretty well covered in the documentation.

Ed Hurst is Associate Editor of Open for Business. Ed is also the Music Director for Grace Baptist Church of Kickapoo Creek, Texas. He loves computers, runs GNU/Linux and reads all sorts of things. You can reach Ed at ehurst@ofb.biz.