Tuesday, August 21, 2012

Xmonad on a fresh debian install

   I've decided to try Xmonad as my window manager.  Xmonad is a tiling window manager that automatically arranges the application windows in the display such that the entire screen is used.  Unlike the more common stacking or compositing window managers, Xmonad does not allow overlap.  Since the entire screen is used, I don't need a desktop environment either.  The numerous default keyboard commands and the ease of customization can reduce the need to use the mouse.
   Rather than suffer through removing the desktop and related packages I will do a fresh install of the core debian system.  Grab the iso for your architecture from the debian website.  Proceed through the install as normal except when you get to the tasksel menu, de-select the "Desktop Environment" option, which is at the top of the list.  The taskel menu is shown in the figure below, and you want all options unchecked for a bare bones debian install.
   Reboot the machine after the install is complete.  You will login on a TTY window, then su to login as root, and install the following packages.  'ROOTPROMPT$' is just your TTY prompt.
ROOTPROMPT$> apt-get install xorg 
ROOTPROMPT$> apt-get install xmonad
ROOTPROMPT$> apt-get install alsa-base alsa-utils
ROOTPROMPT$> apt-get install chromium-browser
ROOTPROMPT$> apt-get install emacs
   Feel free to substitute your browser and text editor of choice in those last two commands.  Configure alsa with the following command, then exit root.
ROOTPROMPT$> alsactl init
ROOTPROMPT$> exit
Your system should now have sound. UPDATE: Running through my own install instructions for a new machine, I did not have sound after this step.  I fixed my low volume with snd_hda_intel module problem based on this snd_hda_intel howto.
   The following command sets xmonad to be called as the window manager when X is started.  If you have other window managers installed you will need to comment them out.  However, if you are following this tutorial that should not be the case.  Read more about the debian specifics of .xinitrc, or a general synopsis of .xinitrc.
$> echo "xmonad" >> /home/USER/.xinitrc
Now you can start X11, which will call xmonad as the window manager.
$> startx
You will get a blank screen, and need to press alt+shift+enter to start xterm (the default terminal emulator).  From xterm you can launch your browser and start reading through the xmonad default key commands.  This screenshot shows my simple desktop with a chromium window as the master (on the left) and a root terminal (top) and a user terminal (bottom) on the right.  Following only the preceding instructions will get you an xterm with black text on a white background.  Subsequent posts will cover xterm and bash customization, as well as some additional xmonad configuration.

No comments:

Post a Comment