xmonad is a tiling window manager. On a Debian GNU/Linux system, you can install it and other useful packages for compiling a custom configuration with the command:
apt-get install xmonad ghc libghc-xmonad-dev libghc-xmonad-contrib-dev
If you are not familiar with xmonad and xmonad configuration, you may want to read the following pages:
I managed to write my configuration files with a lot of googling. Some web pages have been particularly helpful:
Here is a description of my xmonad configuration. The description is also available in the README file in the GitHub repository.
Mod + shift + q and mod + q trigger a "system" menu (Shutdown / Reboot / Exit / Lock / Restart XMonad)
Note that the Shutdown and Reboot commands won't work if the user is not allowed to run "sudo poweroff" and "sudo reboot" without password. To allow the users to run "sudo poweroff" and "sudo reboot" without password, the system administrator may add this line in /etc/sudoers using visudo:
ALL ALL=NOPASSWD: /sbin/poweroff, /sbin/reboot
Not also that the Lock command launches xtrlock and thus won't work if xtrlock is not installed on the system. On a Debian GNU/Linux system, you can install it with the command (as root):
apt-get install xtrlock
The workspaces are given names:
Some applications are automatically moved to particular workspaces:
On xmonad startup or restart, the script .xmonad/hooks is run with the "startup" argument which causes three applications to be automatically launched, if they are installed on the system and if they are not already run by the user:
As already mentioned, Claws Mail and Firefox are automatically moved to particular workspaces.
dclock is permanently displayed in the upper right corner of the screen and shows the time and date. In the text of the .xmonad/xmonad.hs file, it is assumed that the screen is 1920 pixels wide. If your screen is a different resolution, then you probably want to replace 1920 with the pixel width of your screen.
On a Debian GNU/Linux system, you can install dclock with the command (as root):
apt-get install dclock
It is possible to partially or totally disable the script .xmonad/hooks through environment variables definitions. Please run the script .xmonad/hooks with the --help option for more information.
There are two layouts available in each workspace: the "fixed column" layout and the "full screen" layout. You can switch between them with Mod + space. Actually, there is one exception: In the browsing workspace, the "fixed column" layout is not available. Instead, the tall layout is available, with the master pane being 4/9 of the screen width.
In workspaces 1 to 4, the width of the master pane in the "fixed column" layout is fixed to 80 characters, which is good for working in a terminal or editing a file in (say) Vim with a 80 characters text width.
In the four "edit" workspaces (workspaces 6 to 9), the width of the master pane in the "fixed column" layout is fixed to 163 characters which is good for editing two files side by side in Vim (vertical split) with the foldcolumn option set to 1 and a 80 characters text width in both files.
You might want to try the Wibafoco Vim plugin which
automatically changes the foldcolumn option depending on the Vim window width.
This plugin is available here:
In addition to the xmonad.hs file, I had to write a few other files to achieve a satisfactory configuration.
A .xbindkeysrc file to bind the multimedia keys of the keyboard to command lines.
The "volume up", "volume down" and "mute" keys are bound to amixer commands.
The "next track", "previous track" and "pause" keys are bound to MOC (music on console) commands. The "next track" key in particular is bound to a not so trivial command:
mocp -S 2>/dev/null; if [ $? -eq 0 ]; then mocp -p; else mocp -f; fi;
which causes MOC to play the next track if it is already running, or to be launched and start playing if it is not already running. If you have all your music in a single play list, and the MOC shuffle mode enabled in .moc/config, then you can have your music start playing in random order by pressing only the "next track" key and you never need to open the MOC interface.
Of course, all this requires that xbindkeys, amixer and MOC are installed on the system. On a Debian GNU/Linux system, you can install them using the command:
apt-get install xbindkeysrc alsa-utils moc
In the GitHub repository, you can find the whole set of files that
I wrote to achieve the configuration: