Use Xmonad on SolusOS

SolusOS is an awesome distro, it's fast, clean and stable. It reminds me of the good old days when I first discovered the wonderful world of Linux. And since Im an aficionado of Xmonad, a tiling window manager, one of the very first things I do after installing SolusOS is to try to get Xmonad to work on SolusOS. And as I expected, everything works out very well without any problem. I currently use Xmonad as the window manager in SolusOS and the desktop environment is still Gnome. In other words, I still use all the Gnome stuffs like the gnome panel and its applets, the only change here is that Metacity is replaced by Xmonad.

Here is how to get Xmonad to work on SolusOS:

Step 1: Install Xmonad

Open the terminal ( or you can hit Alt+F2) and run the following command to install xmonad and the necessary haskell packages:
 apt-get install xmonad libghc6-xmonad-dev libghc6-xmonad-contrib-dev  

The size of the total packages is only around 70MB so it wont take long to download and install.

Step 2: Create a config file for xmonad

Create the folder ~/.xmonad then use gedit to create the file ~/.xmonad/xmonad.hs

Since you will want to use Xmonad with Gnome on SolusOS, the xmonad.hs file will be like this:
  import XMonad    
  import XMonad.Config.Gnome   
  main = do    
   xmonad $ gnomeConfig   

If you are using a keyboard with azerty layout, you need a little tweak in the xmonad.hs file to make the keyboard work:
  import XMonad    
  import XMonad.Config.Gnome    
  import XMonad.Config.Azerty    
  import qualified Data.Map as M   
   main = do    
     xmonad $ gnomeConfig {    
        keys = \c -> azertyKeys c `M.union` keys gnomeConfig c    

Save the xmonad.hs file, then open the terminal and run the following command to compile the new xmonad config:
 xmonad --recompile  

To know more about how to configure the xmonad.hs file, you can read my xmonad tutorial, I cover all the basic things about Xmonad in this tutorial.

Step 3: Replace Metacity with Xmonad

Just open the terminal (or hit Alt+F2) and run the following command:
 gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string  

And everything is done, just log out and log in again and you can use Xmonad within Gnome on SolusOS. Here is the screenshot of Xmonad on SolusOS in action:

SolusOS Xmonad

1 - You may need to replace the Gnomenu Cardapio widget on gnome panel with the default Gnome menu because Xmonad doesnt play well with Gnomenu Cardapio menu. Another thing to add to the panel is the workspaces indicator to keep track of the workspaces since we dont use any status bar here. To add these widgets to the gnome panel, just right click on the panel and pick the first option "Add to Panel" then choose the widgets you need.

2 - If you prefer to use Xmonad as desktop enviroment instead of using it inside Gnome, you just need to select Xmonad as the desktop environment when log in.

3 - If you have tried Xmonad on SolusOS and dont like it, you can switch everything back to normal by running the following command (then log out and log in again):
 gconftool-2 -s /desktop/gnome/session/required_components/windowmanager metacity --type string  
linux tips and tricks