Xmonad is a tiling window manager written and configured in Haskell.
I decided to use Xmonad without Gnome or any other desktop manager.
As said >>here<<: "The advantages of using xmonad in Ubuntu without a full DE are speed and reduced memory use."
It's not only the overall performance that will be better, but also your working speed once you got used to navigating the tiling windows. I tried xmonad the first time on Arch and I never want back to non-tiling windows since then.
You will need your mouse much less than before and you will get the most out of your screen as it isn't filled with unnecessary stuff, unless you want to.
You can use the following description to set up your own Xmonad or just to see what is possible.
Look at the end of my post for links to some other guides, i.e. using Xmonad in Gnome.
myLayout = Mirror tiled ||| tiled ||| Full
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 3/4
-- Percent of screen to increment by when resizing panes
delta = 3/100
--fades inactive windows, but is a bit distracting
--myLogHook :: X ()
--myLogHook = fadeInactiveLogHook fadeAmount
-- where fadeAmount = 0.8
-- add --depth 32 for transparency, you need xcompmgr for shadows and transparency effects
, terminal = "urxvt -bg rgba:0000/0000/0000/eeee -fg rgba:cc00/cc00/cc00/ffff +vb +sb"
-- spawn programs you want at startup
, startupHook = do
spawn "thunderbird"
spawn "firefox"
-- set your layout, smartborders removes window borders if not necessary
, layoutHook = fullscreenFull $ avoidStruts $ smartBorders myLayout
-- names and sequence of your workspaces
, workspaces = ["web", "shell", "mail", "coding", "irc"] ++ map show [6..9]
-- sets the windows key as mod key
, modMask = mod4Mask
-- pipe title information into top bar of xmobar
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
-- set your border colors
, normalBorderColor = myNormalBorderColor
, focusedBorderColor = myFocusedBorderColor
}`additionalKeys`
[ -- use Ctrl + Alt + L to lock the screen
((mod1Mask .|. controlMask, xK_l), spawn "gnome-screensaver-command --lock")
-- use Ctrl + Print to make a delayed screenshot
, ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
-- use Print to make a screenshot
, ((0, xK_Print), spawn "scrot")
-- Mod + g for gridselection for your workspaces
, ((mod4Mask, xK_g), goToSelected defaultGSConfig)
]
Make sure that the file compiles by typing on the command line:
Code:
ghc --make xmonad.hs
or
Code:
xmonad --recompile
Set up a custom xsession by creating a file in /usr/share/xsessions/custom.desktop that looks i.e. like this (Name can be whatever you like):
xmobar is a minimalistic text based status bar that works well with xmonad and is also written in Haskell.
Set up the config files for the bars on top and bottom.
Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, position = Bottom
, lowerOnStart = True
, commands = [ Run Weather "EDDP" ["-t","<station>: <tempC> C","-L","10","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
, Run MultiCpu ["-t", "CPU: <autobar>" , "-L","3","-H","50","--normal","green","--high","red", "-b", ":", "-f", ":"] 10
, Run StdinReader
, Run Com "uname" ["-s","-r"] "" 36000
, Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
]
, sepChar = "%"
, alignSep = "}{"
, template = "%multicpu% } %uname% { %EDDP% | <fc=#ee9a00>%date%</fc>"
}
Now log out of your current session and log in into your custom xsession (switch the session by clicking on the icon in the default Ubuntu login screen).
Last but not least use the gtk-theme-switch2 command to set up a theme you like.
The tool lxappearance may work too, but it didn't for me.
In order to use these you should either call xmobar in your xmonad.hs (or wherever you call it) with the absolute path or add this to the root path (Note: this won't work by editing .bashrc, because that wouldn't be root)