IceWM on Slackware 14.2

10 October 2016
I recently rebuilt my laptop using Slackware 14.2 in part so I could evaluate what Slackware is like these days as a primary OS. For some reason many thing that just worked out of the box with Xfce such as audio/video and drive mounting didn't with IceWM. Here I have documented what I did to get things working properly with IceWM, as well as reproducing previous solutions to other IceWM problems I have come across in the past.

For most of the problems the underlying cause was permissions issues, which for some reason were bypassed in Xfce. For these the solution is to add the user to various groups, which the following commands run as root will fix up (with $USER substitiued as appropriate):

usermod -a -G video $USER usermod -a -G audio $USER usermod -a -G plugdev $USER usermod -a -G cdrom $USER


When I first started using Linux I quite liked KDE v1, but for reasons I've long forgotten I found KDE3 as shipped with RedHat 7.3 a bit too heavyweight for my liking. Around the same time my (then) University department replaced the Sun workstations in the main computer lab with Linux boxes, and the default Gnome window manager was a constant source of problems. I eventually settled on IceWM with a vaguely WinXP-esque theme as my preferred window manager, in part helped by it only taking up a few MB of filespace. Whatever the pre-history, IceWM has stayed my preferred window manager, although there has been variation in what theme I've used. At least since I've used Ubuntu, I've not even tried using any other window manager for any significant length of time, often simply because they have been crap.

I'm not exactly sure when Xfce first came onto my radar, but when I built my company development VM I chose it as my window manager. Having worked out how to configure Xfce to my personal states I then opted to use it on my laptop, partly because on a laptop stuff like brightness hot-keys and power reserve alerts matter, although in the longer term I will probably rebuild my desktop as well where I will want to use IceWM.

Missing window decorations

This is a problem I came across with IceWM in Slackware 14.1, although it seems to be an issue with more recent versions of the Xorg X11 server and is not Slackware-specific, as I saw the same problem on RedHat-based systems. The issue is parts of window decoration not being rendered, as shown below:

Can't remember which website forum put me on to the right track, but some display adapter drivers have problems with one-pixel-wide bitmaps that are stretched, so the solution is to resize them with something like ImageMagick's convert so they are instead two pixels wide. My previous article includes a Bash shell script to do this, which for convenience I reproduce below:

#!/bin/bash for img in *.xpm; do    WIDTH=`identify -format "%[fx:w]" $img`    if [ $WIDTH -eq 1 ]; then        HEIGHT=`identify -format "%[fx:h]" $img`        echo Scaling $img..        convert $img -resize 2x${HEIGHT}! out/${img}    fi done;

The exclamation mark in “2x${HEIGHT}!” tells ImageMagick not to try preserving aspect ratio.

CDs/DVDs & USB sticks not being detected

Although the insertion of media devices such as USB drives is showing up in dmesg, their presence is not showing up in the Thunar file manager. As far as I can tell this is because dbus events related to media insertion are getting lost because the dbus-launch background process is not setup. The quickest way to test this is to start Thunar using dbus-launch directly:

dbus-launch thunar

A more permanent solution is to start IceWM itself using dbus-launch, using a shell-script wrapper around icewm-session like the one below, as this ought to also fix any other problems related to lost dbus events.

#!/bin/bash exec dbus-launch --exit-with-session icewm-session

I'm not sure why, but the manpage for dbus-launch state that the --exit-with-launch parameter is required, although it seems to work without it. Assuming the above script is saved as, you then need to get your display manager to use it instead of icewm-session. For instance, with SDDM you need to change /usr/share/xsessions/icewm.desktop to something like the following:

[Desktop Entry] Version=1.0 Name=IceWM Session Comment=Use this session to run IceWM as your desktop environment Type=XSession

Unable to unmount/eject

When you try to eject a DVD or USB stick using the eject icon within Thunar, you might get a dialog with the message Not authorized to perform operation like the one shown below:

This is a permissions issue, as the user needs to be in the plugdev group to get hotplug events. For some reason this also covers CD/DVD ejections, although I would suggest adding to the cdrom group as well.

Doom 3 fails to load

Rather than starting up with the Doom3 loading splash screen you just get a black screen, and most likley having to restart the X11 server using Ctrl-Alt-Backspace. If you redirected Doom3's stdout to a file it may have the following in it pointing towards an error with the OpenGL sub-system:

----- R_InitOpenGL ----- Setup X display connection dlopen( Initializing OpenGL display Using XFree86-VidModeExtension Version 2.2 DGA DirectVideo Mouse (Version 2.0) initialized Free86-VidModeExtension Activated at 640x480 Using 8/8/8 Color bits, 8 Alpha bits, 24 depth, 8 stencil display. Fatal X Error: Major opcode of failed request: 153   Minor opcode of failed request: 3   Serial number of failed request: 49 BadValue (integer parameter out of range for operation) Fatal X Error:   Major opcode of failed request: 153   Minor opcode of failed request: 5   Serial number of failed request: 51 GLXBadContext Fatal X Error:   Major opcode of failed request: 153   Minor opcode of failed request: 26   Serial number of failed request: 51 0 GL_RENDERER: (null) GL_EXTENSIONS: (null) signal caught: Hangup si_code 0 Trying to exit gracefully.. idRenderSystem::Shutdown() double fault Hangup, bailing out

This is caused by lack of permissions to access /dev/dri/card0, but since this has video as the owning group, the solution is to add yourself to that group.

Hibernating & sleeping

Since IceWM itself doesn't provide sleep and hibernate buttons, if you want to use these features, you need to trigger them using another mechanism. My personal preference is to create a shell-script with the following in it to trigger hibernaton:

#!/bin/bash echo Hibernating.. dbus-send --system --print-reply --dest="org.freedesktop.UPower" \     /org/freedesktop/UPower org.freedesktop.UPower.Hibernate

For sleeping, change Hibernate to Suspend in the above snippit. As detailed elsewhere this code snippit may well have permission issues, but my personal inclination is to simply SUID root the script than mess around with policy kit.

Various useful commands

These commands are not IceWM-specific but they are useful as IceWM doesn't itself provide any control over the underlying X11 server parameters.
Adjusts screen brightness. The command can take both an absolute percentage to set brightness to, and a relative value to adjust brightness by. The latter usage can be used to setup brightness hot-keys.
xset -q s
Query X11 screen settings.
sleep 1; xset s activate
Blanks the screen. The sleep is needed to ensure the keyboard events caused by typing the command don't immediately wake up the screen.
xset s blank
Screensaver blanks (turns off) screen, if supported The alternative noblank results in the desktop background being shown rather than the screen being blanked. I've not investigated what contributes to this image.
xset s 600 900
Sets screensaver timeout values The first value is time in seconds of inactivity before the screensaver kicks in. The second parameter isn't relevant if screen blanking is selected and it can be omitted, but from what I've read it is how often the background image is changed to avoid burn-in. Sometimes video playback software temporaraly sets these values to zero and then for whatever reason doesn't restore them when playback is stopped.