17 Window Managers

06 Aug

This article has grown to 19 windowmanagers by now. It might grow even more.
But of course there are even more window managers than this! I think Linux is somewhat famous for having so many.

My interest was in those that

  • typically run in a standalone session (not as part of a desktop environment, like e.g. mutter for gnome)
  • are somewhat maintained, not too obscure or specialized

I also have a special interest in those that can do both floating and tiling, but not all windowmanagers presented here fulfil that.

The screenshots provide only a very quick overview: what you would be presented with after succesfully starting them for the first time. They do not "show off" their beauty and/or functionality.

I have explored some windowmanagers deeper; you can find links to those articles here and besides the corresponding screenshots:

  1. dwm
  2. twm
  3. i3wm
  4. fluxbox

Tested on Arch Linux, August - November 2016
This article now has an accompanying forum thread.
It is also inspired by this older forum thread.

After you installed the window manager(s), log out.
If you use a display/login manager, you might be able to choose different sessions, and with a little bit of luck your window manager of choice already provides one. If not, follow these instructions.

If you start X via ~/.xinitrc, here are some helpful snippets:

add this to ~/.bash_profile (might be ~/.profile on some systems, but this snippet includes bashisms):
The only bit you might want to edit is the array of window manager executables in the first line. Even so, each entry is tested with which before presenting it as a choice.

Xsessions=(awesome blackbox bspwm cwm dwm echinus fluxbox fvwm herbstluftwm i3 \
jbwm lwm notion openbox pekwm qtile spectrwm twm vtwm)

echo "Available Xsessions:"

for (( i=0 , j=1 ; i<${#Xsessions[@]} ; i++ )); do
  if which "${Xsessions[i]}" >/dev/null 2>&1; then
    choices=( ${choices[@]} ${Xsessions[i]} )
    tput setaf $((j%6 + 1 ))
    echo -e "$((j++))\t${Xsessions[i]}"
tput setaf $((j%6 + 1 ))
echo -e "Ctrl+C\tcommand line"
tput sgr0

while (( key > ${#choices[@]} )) || (( key <= 0 )) ; do
    read -p "Enter choice: " key

if (( key != 0 )) ; then
    echo "$key: ${choices[$((--key))]}"
    export XSESSION="${choices[key]}"
    [[ -z $DISPLAY ]] && sx

then add this to ~/.xinitrc:

xsetroot -solid "#221111"
xterm &
exec $XSESSION > ${XSESSION}log 2>&1

I recommend starting an xterm (or some other terminal) before the window manager, because it won't always be easy to start one during the session. Not all window managers handle Keyboard shortcuts (!) and even so, the keys or mouseclicks required differ. Try opening a terminal with Win+Enter or Alt+Enter or Shift+Alt+Enter. Try clicking on the desktop, left right and middle...

for more in-depth experimenting one could replace the previous snippet with this:

exec $XSESSION > ${XSESSION}log 2>&1 &
# XSESSION defined through user choice in ~/.bash_profile
 . $HOME/.config/autostart.sh
} &
wait $wm_pid

this will start the Xsession defined in the previous snippet, and allows you to execute some autostart stuff with any window manager, even those that don't usually support it.

additionally, your ~/.config/autostart.sh could contain sth like this:

# also see ~/.bash_profile
case $XSESSION in
        stuff &
        otherstuff &
        morestuff &
        # this will be executed for all wms that are not in the above list;
        # but it will NOT be executed for any of the above!
        stuff &

Once a final (or long-term) decision is made, this should be changed again to a more streamlined startup. Many windowmanagers offer everything that is needed for autostarting applications, no need for additional scripts.

Next Post Previous Post