27. Window Managers
Window Managers and Desktop Environments are the primary user interfaces into the X Window System. A window manager is a program that controls the appearance of windows and provides the means by which the user can interact with them. A Desktop Environment provides a more complete interface to the operating system, and provides a range of integrated utilities and applications.
There are many Window Managers available. Some of the more well known ones include fvwm2, Window Maker, AfterStep, Enlightenment, Sawfish, and Blackbox.
The Desktop Environments available for Linux are GNOME, KDE, and XFce.
Choosing a Window Manager or Desktop Environment is highly subjective. The choice depends on the look and feel of the packages, the resources (RAM, disk space) required, and the utilities included. One web site that provides a very good summary of what is available, screenshots, and their respective features is Window Managers for X.
In this chapter, the installation instructions of several Window Managers and one lightweight Desktop Environment are presented. Later in the book, both KDE and GNOME have their own sections.
27.1 Fluxbox-1.3.7
Introduction to Fluxbox
The Fluxbox package contains a window manager.
This package is known to build and work properly using an LFS 11.3 platform.
Package Information
-
Download (HTTP): https://downloads.sourceforge.net/fluxbox/fluxbox-1.3.7.tar.xz
-
Download MD5 sum: b44afd10ee1e64624c23115aa51dcd55
-
Download size: 772 KB
-
Estimated disk space required: 101 MB
-
Estimated build time: 0.9 SBU
Fluxbox Dependencies
Required
Optional
dbus-1.14.6 (runtime), FriBidi-1.0.12, and imlib2-1.9.1 (if you wish to use other image formats in addition to XPM)
User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/fluxbox
Installation of Fluxbox
First, fix a build failure when building with gcc-11.1:
sed -i '/text_prop.value > 0/s/>/!=/' util/fluxbox-remote.cc
Install Fluxbox by running the following commands:
./configure --prefix=/usr &&
make
This package does not have a working test suite.
Now, as the root user:
make install
Configuring Fluxbox
###
Config Files
~/.fluxbox/init, ~/.fluxbox/keys, and ~/.fluxbox/menu
Configuration Information
If Fluxbox is the only Window Manager you want to use, you can start it with an .xinitrc file in your home folder. Be sure to backup your current .xinitrc before proceeding.
echo startfluxbox > ~/.xinitrc
Or alternatively, if you use a login manager like GDM-43.0 or lightdm-1.32.0, and would like to be able to choose Fluxbox at the login prompt, create a fluxbox.desktop file. As root:
mkdir -pv /usr/share/xsessions &&
cat > /usr/share/xsessions/fluxbox.desktop << "EOF"
[Desktop Entry]
Encoding=UTF-8
Name=Fluxbox
Comment=This session logs you into Fluxbox
Exec=startfluxbox
Type=Application
EOF
If you didn’t install GDM-43.0 or lightdm-1.32.0 in /usr, then change that command to fit the prefix you chose.
Now create the Fluxbox configuration files:
mkdir -v ~/.fluxbox &&
cp -v /usr/share/fluxbox/init ~/.fluxbox/init &&
cp -v /usr/share/fluxbox/keys ~/.fluxbox/keys
To generate the application menu, first you may wish to run fluxbox-generate_menu -h, in order to choose any <user_options>, then issue:
cd ~/.fluxbox &&
fluxbox-generate_menu <user_options>
Alternately, copy a pregenerated menu:
cp -v /usr/share/fluxbox/menu ~/.fluxbox/menu
Menu items are added by editing ~/.fluxbox/menu. The syntax is explained on the fluxbox man page.
If you want to use an image as your desktop background, copy the theme you like into ~/.fluxbox. Then add a line to make it use the correct image. In the following command, change <theme> for the name of the theme you want and change </path/to/nice/image.ext> to point to the actual image you want to use, where ext must be “xpm”, if imlib2-1.9.1 is not installed to allow other image formats.
cp -r /usr/share/fluxbox/styles/<theme> ~/.fluxbox/theme &&
sed -i 's,\(session.styleFile:\).*,\1 ~/.fluxbox/theme,' ~/.fluxbox/init &&
[ -f ~/.fluxbox/theme ] &&
echo "background.pixmap: </path/to/nice/image.ext>" >> ~/.fluxbox/theme ||
[ -d ~/.fluxbox/theme ] &&
echo "background.pixmap: </path/to/nice/image.ext>" >> ~/.fluxbox/theme/theme.cfg
In some locales the font specified in the theme may not contain the needed characters. This results in menus with blank items. You can fix this by editing ~/.fluxbox/theme with a text editor and altering it so that it names a suitable font.
Contents
Installed Programs: fluxbox, fbsetbg, fbsetroot, fluxbox-generate_menu, startfluxbox, fbrun, fluxbox-remote, and fluxbox-update_configs
Installed Libraries: None
Installed Directories: /usr/share/fluxbox and ~/.fluxbox
Short Descriptions
fluxbox is a window manager for X11 based on Blackbox 0.61.0.
fbsetbg is a utility that sets the background image. It requires one of the following at runtime: Esetroot, wmsetbg, feh, hsetroot, chbg, display, qiv, xv, xsri, xli, or xsetbg. It also requires which if Esetroot is found.
fbsetroot is a utility to change root window appearance based on the Blackbox application bsetroot.
fluxbox-generate_menu is a utility that generates a menu by scanning your PATH.
startfluxbox is a session startup script that allows for command executions prior to fluxbox starting.
fbrun displays a run dialog window.
fluxbox-remote provides command line access to key commands for Fluxbox.
fluxbox-update_configs use to manage config files (reload, update, test).
27.2 IceWM-3.3.1
Introduction to IceWM
IceWM is a window manager with the goals of speed, simplicity, and not getting in the user’s way.
This package is known to build and work properly using an LFS 11.3 platform.
Package Information
-
Download (HTTP): https://github.com/ice-wm/icewm/archive/3.3.1/icewm-3.3.1.tar.gz
-
Download MD5 sum: 2fe3d2ebbe34ebbd4d091555f1c96ed3
-
Download size: 2.3 MB
-
Estimated disk space required: 46 MB
-
Estimated build time: 0.3 SBU
IceWM Dependencies
Required
CMake-3.25.2, a graphical environment, and gdk-pixbuf-xlib-2.40.2
Optional
asciidoc-10.2.0 (for regenerating the HTML documentation), FriBidi-1.0.12 (for languages written right to left), imlib2-1.9.1, librsvg-2.54.5, libao-1.2.0, libsndfile-1.2.0, and alsa-lib-1.2.8 (for the experimental icesound program)
User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/icewm
Installation of IceWM
Install IceWM by running the following commands:
mkdir build &&
cd build &&
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCFGDIR=/etc \
-DENABLE_LTO=ON \
-DCONFIG_GDK_PIXBUF_XLIB=ON \
-DCONFIG_IMLIB2=OFF \
-DDOCDIR=/usr/share/doc/icewm-3.3.1 \
.. &&
make
This package does not have a working test suite.
Now, as the root user:
make install
This package creates two .desktop files in the /usr/share/xsessions/ directory. Both are not needed in a BLFS system, so prevent the extra file showing up as an option in a display manager. As the root user:
rm -v /usr/share/xsessions/icewm.desktop
Command Explanations
-DENABLE_LTO=ON: This option enables Link Time Optimization and is required for this package.
Configuring IceWM
###
Config Files
~/.icewm/keys, ~/.icewm/menu, and ~/.icewm/preferences, and ~/.icewm/toolbar, and ~/.icewm/winoptions. The default versions are installed in /usr/share/icewm/ and will be used if you have not copied them to ~/.icewm.
Configuration Information
If IceWM is the only Window Manager you want to use, you can start it with an .xinitrc file in your home folder. Be sure to backup your current .xinitrc before proceeding.
echo icewm-session > ~/.xinitrc
Now create the IceWM configuration files:
mkdir -pv ~/.icewm &&
cp -v /usr/share/icewm/keys ~/.icewm/keys &&
cp -v /usr/share/icewm/menu ~/.icewm/menu &&
cp -v /usr/share/icewm/preferences ~/.icewm/preferences &&
cp -v /usr/share/icewm/toolbar ~/.icewm/toolbar &&
cp -v /usr/share/icewm/winoptions ~/.icewm/winoptions
You can now edit these files to meet your requirements. In particular, review the preferences file. You can use Logout -> Restart-IceWM on the main menu to load your changed preferences, but changes to the background only take effect when IceWM is started.
At this point you can either modify the traditional menu files to suit your requirements, or use the newer icewm-menu-fdo described later.
The syntax of the menus is explained in the help files, which you can access by running help from the menu, but some of the detail is out of date and the default selections in the menus (a few old applications on the main menu, everything else on the Programs menu) will benefit from being updated to meet your needs. The following examples are provided to encourage you to think about how you wish to organise your menus. Please note the following:
-
If a program listed in the menu has not been installed, it will not appear when the menu is displayed. Similarly, if the program exists but the specified icon does not, no icon will be displayed in the menu.
-
The icons can be either
.xpmor.pngfiles, and there is no need to specify the extension. If the icon is located in the “library” (/usr/share/icewm/icons) there is no need to specify the path. -
Most programs are in sub-menus, and the main menu will always append entries for
windows, help, settings, logoutat the bottom. -
An icon for firefox was copied to the library directory and given a meaningful name. The icon for xine is
xine.xpmwhich was installed to a pixmap directory. -
The default toolbar is not altered.
If you wish to use this traditional method, there are more examples in previous releases of this book (e.g. BLFS-7.8).
Alternatively, you can create a menu which conforms to the FDO Desktop Menu Specifications, where programs can be found because they have a .desktop file in the XDG_DATA_HOME or XDG_DATA_DIR directories. Unlike most windowmanagers, icewm does not search for programs when the menu is invoked, so if you take this route you will need to rerun the following command after installing or removing programs:
icewm-menu-fdo >~/.icewm/menu
If you wish to put icons on your desktop, you will need to install a program such as Rox-Filer-2.11 which provides a pinboard. If you do that you will no longer be able to access the menu by right-clicking on the desktop, you will have to use the IceWM button. To ensure that the rox pinboard is running, the following commands will put it in the startup file:
cat > ~/.icewm/startup << "EOF"
rox -p Default &
EOF &&
chmod +x ~/.icewm/startup
Tip
There are a number of keyboard shortcuts in IceWM:
-
Ctrl + Alt + F
N: go totty`N`. -
Ctrl + Alt +
N: go to desktop numberN -
Ctrl + Alt + Space : open a box on the taskbar where you can key in the name of an application and run it.
Contents
Installed Programs: icehelp, icesh, icesound, icewm, icewm-menu-fdo, icewm-menu-xrandr, icewm-session, icewm-set-gnomewm, icewmbg, and icewmhint
Installed Libraries: None
Installed Directories: /usr/share/doc/icewm-3.3.1, /usr/share/icewm and ~/.icewm
Short Descriptions
icehelp is used to display the html manual.
icesh is a command-line window manager which can be used in ~/.icewm/startup.
icesound plays audio files on GUI events raised by IceWM.
icewm is the window manager.
icewm-menu-fdo can create a file in a format suitable for an IceWM menu, which lists those programs currently installed in a layout conforming to the FDO Desktop Menu Specifications.
icewm-menu-xrandr is a helper program used to manage multi-screen configurations.
icewm-session runs icewmbg, icewm, icewmtray, startup, shutdown (i.e. startup and shutdown scripts are run if installed).
icewm-set-gnomewm is a script to set the GNOME window manager to icewm using gconftool.
icewmbg is used to set the background, according to the various DesktopBackground settings in the preferences.
icewmhint is used internally to provide hints to the user.
27.3 openbox-3.6.1
Introduction to openbox
Openbox is a highly configurable desktop window manager with extensive standards support. It allows you to control almost every aspect of how you interact with your desktop.
This package is known to build and work properly using an LFS 11.3 platform.
Package Information
-
Download (HTTP): http://openbox.org/dist/openbox/openbox-3.6.1.tar.gz
-
Download MD5 sum: b72794996c6a3ad94634727b95f9d204
-
Download size: 944 KB
-
Estimated disk space required: 21 MB
-
Estimated build time: 0.3 SBU
Openbox Dependencies
Required
a graphical environment and Pango-1.50.12 (compiled with support for libXft)
Optional
dbus-1.14.6 (runtime), imlib2-1.9.1 (to enable icons in the right click menu), ImageMagick-7.1.0-61 (to show desktop backgrounds as seen in the Configuration Information section below), PyXDG-0.28, startup-notification-0.12, and librsvg-2.54.5
User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/openbox
Installation of Openbox
Note
If XORG_PREFIX is not /usr, tell gcc about it:
export LIBRARY_PATH=$XORG_PREFIX/lib
If you only installed the Python 3 PyXDG module convert one of the scripts to Python 3:
2to3-3.11 -w data/autostart/openbox-xdg-autostart &&
sed 's/python/python3/' -i data/autostart/openbox-xdg-autostart
Install Openbox by running the following commands:
./configure --prefix=/usr \
--sysconfdir=/etc \
--disable-static \
--docdir=/usr/share/doc/openbox-3.6.1 &&
make
This package does not come with a test suite.
Now, as the root user:
make install
This package creates three .desktop files in the /usr/share/xsessions/ directory. Two of these are not appropriate in a BLFS system, so prevent the extra files showing up as options in a display manager. As the root user:
rm -v /usr/share/xsessions/openbox-{gnome,kde}.desktop
Command Explanations
--sysconfdir=/etc: This option puts Openbox’s configuration files in /etc/xdg/openbox instead of /usr/etc/xdg/openbox.
--docdir=/usr/share/doc/openbox-3.6.1: this puts a few files in a versioned directory in /usr/share/doc.
--disable-static: This switch prevents installation of static versions of the libraries.
Configuring Openbox
Config Files
/etc/xdg/openbox/autostart, /etc/xdg/openbox/menu.xml, /etc/xdg/openbox/rc.xml, ~/.config/openbox/autostart, ~/.config/openbox/menu.xml and ~/.config/openbox/rc.xml
Configuration Information
Openbox’s right click menu can be used to launch programs. The menu itself is configured with 2 files, /etc/xdg/openbox/menu.xml and ~/.config/openbox/menu.xml. To make changes to the menu, copy /etc/xdg/openbox/menu.xml to ~/.config/openbox/menu.xml and edit it:
cp -rf /etc/xdg/openbox ~/.config
~/.config/openbox/menu.xml can be edited with a text editor or you can install Obmenu (requires pyxml and PyGTK-2.24.0).
To have icons in your right click menu requires installing imlib2-1.9.1 before you install Openbox. To set an icon for an entry in the menu edit ~/.config/openbox/menu.xml and add an icon to the
<item label="Mplayer" icon="/usr/share/pixmaps/mplayer.png">
Many other aspects of Openbox’s behavior are configured with ~/.config/openbox/rc.xml such as what keybindings are used to launch programs or which mouse button launches the main menu.
Details of the theme that Openbox applies to window decorations are configured in ~/.config/openbox/rc.xml. You can get a list of the available themes with the command:
ls -d /usr/share/themes/*/openbox-3 | sed 's#.*es/##;s#/o.*##'
Starting Openbox
To automatically start openbox when you start Xorg:
echo openbox > ~/.xinitrc
If you want to set a background image to your desktop you can use display and launch it from ~/.xinitrc just before openbox:
cat > ~/.xinitrc << "EOF"
display -backdrop -window root /path/to/beautiful/picture.jpeg
exec openbox
EOF
Or if you like a bit of variety, put a selection of images in a folder (in this example, the directory ~/.config/backgrounds) and choose one at random each time you xinit:
cat > ~/.xinitrc << "EOF"
# make an array which lists the pictures:
picture_list=(~/.config/backgrounds/*)
# create a random integer between 0 and the number of pictures:
random_number=$(( ${RANDOM} % ${#picture_list[@]} ))
# display the chosen picture:
display -backdrop -window root "${picture_list[${random_number}]}"
exec openbox
EOF
If you like to have the numlock key set when you start Xorg, install Numlockx and add that to your xinitrc. Another useful application is dbus-1.14.6:
cat > ~/.xinitrc << "EOF"
. /etc/profile
picture_list=(~/.config/backgrounds/*)
random_number=$(( ${RANDOM} % ${#picture_list[*]} ))
display -backdrop -window root "${picture_list[${random_number}]}"
numlockx
eval $(dbus-launch --auto-syntax --exit-with-session)
lxpanel &
exec openbox
EOF
Contents
Installed Programs: gdm-control, gnome-panel-control, obxprop, openbox, openbox-gnome-session, openbox-kde-session and openbox-session
Installed Libraries: libobrender.so and libobt.so
Installed Directories: /etc/xdg/openbox, /usr/include/openbox, /usr/share/doc/openbox-3.6.1 and /usr/share/themes.
Short Descriptions
gdm-control is a command line tool to send signals to GDM.
gnome-panel-control is a command line utility to invoke the Gnome Panel run dialog/menu.
obxprop is a tool for displaying the properties on an x window. It has a similar functionality to xprop, but allows you to see UTF-8 strings as text.
openbox is a standards compliant, highly configurable, window manager.
openbox-gnome-session is a script to launch an Gnome session with Openbox as your window manager from your ~/.xinitrc.
openbox-kde-session is a script to launch an KDE session with Openbox as your window manager from your ~/.xinitrc.
openbox-session is a script to launch an Openbox session from your ~/.xinitrc.
libobrender.so contains the functions used by Openbox for theme rendering.
libobt.so is the Openbox toolkit library.
27.4 sawfish-1.13.0
Introduction to sawfish
The sawfish package contains a window manager. This is useful for organizing and displaying windows where all window decorations are configurable and all user-interface policy is controlled through the extension language.
This package is known to build and work properly using an LFS 11.3 platform.
Package Information
-
Download (HTTP): https://download.tuxfamily.org/sawfish/sawfish_1.13.0.tar.xz
-
Download MD5 sum: fd6ca5be0acbee8ea150945d3fb3ec60
-
Download size: 2.7 MB
-
Estimated disk space required: 52 MB
-
Estimated build time: 0.3 SBU
sawfish Dependencies
Required
gdk-pixbuf-xlib-2.40.2, rep-gtk-0.90.8.3, and Which-2.21
Optional
User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/sawfish
Installation of sawfish
Install sawfish by running the following commands:
./configure --prefix=/usr --with-pango &&
make
This package does not come with a test suite.
Now, as the root user:
make install
This package creates six .desktop files in the /usr/share/xsessions/ directory. All but one are needed in a BLFS system, so prevent the extra files showing up as options in a display manager. As the root user:
rm -v /usr/share/xsessions/sawfish-*.desktop
Configuring sawfish
Configuration Information
Be sure to backup your current .xinitrc before proceeding.
cat >> ~/.xinitrc << "EOF"
exec sawfish
EOF
Optionally, you can use a Display Manager, such as lxdm-0.5.3.
From the developers: “The default menu binding is somewhat obscure; you must middle-click on the background to bring up the menus. (If you have a two-button mouse, try clicking both buttons simultaneously)”. You can find this at sawfish’s FAQ.
Contents
Installed Programs: sawfish, sawfish-about, sawfish-client, sawfish-config, sawfish-kde4-session, sawfish-kde5-session, sawfish-lumina-session, sawfish-mate-session, and sawfish-xfce-session
Installed Libraries: Several internal modules under /usr/lib/sawfish tree
Installed Directory: /usr/include/sawfish, /usr/lib/sawfish, /usr/lib/rep/sawfish, and /usr/share/sawfish
Short Descriptions
sawfish is the extensible window manager using a Lisp-based scripting language.
sawfish-about is the sawfish about window.
sawfish-client allows you to connect to a window manager process and evaluate arbitrary Lisp forms.
sawfish-config is the sawfish configuration manager.
sawfish-kde4-session is a script to run KDE4 using sawfish.
sawfish-kde5-session is a script to run Plasma 5 using sawfish.
sawfish-mate-session is a script to run mate using sawfish.
sawfish-lumina-session is a script to run Lumina using sawfish.
sawfish-xfce-session is a script to run xfce using sawfish.