I use the script below to sort of "install" Beside you need to install some sort of programs to make it pleasant.
sudo apt-get install xmonad xmobar dmenu trayer
[B] Make gnome run xmonad wm[/B]
#!/bin/bash
gconftool -t string -s /desktop/gnome/session/required_components/windowmanager "xmonad"
gconftool -t boolean -s /apps/nautilus/preferences/show_desktop false
gconftool -s /desktop/gnome/session/required_components/panel "" -t string
This is my ~/.xmobarrc I am using labtop so the battery you can sort or remove it.
Config {
font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*",
bgColor = "black",
fgColor = "#8822FF",
position = TopW L 90,
lowerOnStart = True,
commands = [
Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10,
Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10,
Run Memory ["-t","Mem: <usedratio>%"] 10,
Run Battery ["-L","30","-H","60","--high","green","--normal","yellow","--low", "red"] 10,
Run Swap [] 10,
Run Date "%V %a %b %_d %H:%M" "date" 10,
Run StdinReader
],
sepChar = "%",
alignSep = "&&",
template = "%StdinReader% && %cpu% | %eth0% | %memory% | %battery% | Week %date% "
}
The bread and butter ~/.xmonad/xmonad.hs. When you have Tall use alt + shift + x to minimize/hide window. alt + x to restore it. If there are too many windows it will hide the old ones too. You can get those auto hide windows back by moving the order of windows with alt + shift + j/k
import XMonad
import XMonad.Actions.CycleWS
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
import XMonad.Layout.Minimize
import XMonad.Layout.LimitWindows
import XMonad.Layout.Tabbed
import XMonad.Layout.Named
import qualified XMonad.StackSet as W
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
myManageHook = composeAll [
isFullscreen --> doFullFloat ]
myTabConfig = defaultTheme { inactiveBorderColor = "#FF0000",
inactiveColor = "#000000",
inactiveTextColor ="#00FFFF",
activeBorderColor = "#0000FF",
activeTextColor = "#00FF00",
activeColor = "#000000"}
myLayout = tall ||| tab ||| full
where
tall = named "Tall" $ limitWindows 4 $ minimize
$ Tall 1 (3/100) (1/2)
tab = named "Tab" $ tabbed shrinkText myTabConfig
full = named "Full" $ Full
main = do
xmproc <- spawnPipe "xmobar"
gnomeRegister :: MonadIO m => m()
xmonad $ gnomeConfig {
manageHook = manageDocks <+> myManageHook
<+> manageHook gnomeConfig,
layoutHook = smartBorders $ avoidStruts $ myLayout,
focusedBorderColor = "#0000FF",
focusFollowsMouse = False,
logHook = do
dynamicLogWithPP $ xmobarPP {
ppOutput = hPutStrLn xmproc,
ppTitle = xmobarColor "blue" "" . shorten 50
}
} `additionalKeys`[
-- Minimize
((mod1Mask .|. shiftMask, xK_x),
(withFocused $ \f -> sendMessage $ MinimizeWin f)
>> windows W.focusDown),
((mod1Mask, xK_x), sendMessage RestoreNextMinimizedWin),
-- Hide Xmobar
((mod1Mask .|. shiftMask, xK_h), sendMessage ToggleStruts),
-- Workspace handling
---- Using left/right
((mod1Mask, xK_Right), nextWS),
((mod1Mask, xK_Left), prevWS),
((mod1Mask .|. controlMask, xK_Right), shiftToNext >> nextWS),
((mod1Mask .|. controlMask, xK_Left), shiftToPrev >> prevWS),
---- Using u/i
((mod1Mask, xK_i), nextWS),
((mod1Mask, xK_u), prevWS),
((mod1Mask .|. controlMask, xK_i), shiftToNext >> nextWS),
((mod1Mask .|. controlMask, xK_u), shiftToPrev >> prevWS),
-- Gnome Settings
((mod1Mask .|. shiftMask, xK_q), spawn "gnome-session-save --gui --logout"),
-- ((mod1Mask .|. shiftMask, xK_q), spawn "killall5"),
((mod1Mask .|. shiftMask, xK_comma), spawn "gnome-session-save --gui --shutdown-dialog"),
((mod1Mask .|. shiftMask, xK_Return), spawn "gnome-terminal"),
((mod1Mask, xK_Print), spawn "gnome-screenshot"),
-- Dmenu
((mod1Mask, xK_p), spawn "dmenu_run"),
((mod1Mask, xK_m), spawn "update-manager"),
((mod1Mask, xK_n), spawn "nautilus ~/")]
This is my ~/.profile file to start trayer and volume control. It is not finished yet.
#gnome-shell --replace
#gnome-settings-daemon
if [ -x "/usr/bin/xmonad" ]
then
# gnome-settings-daemon &
trayer --edge top --align right --SetDockType true \
--SetPartialStrut true --expand true --width 10 \
--height 17 --transparent true --tint 0x000000 --alpha 0 &
# nm-applet --sm-disabled&
gnome-volume-control-applet &
fi
There is a lot to learn when you get into xmonad. I am actually still learning. But if you have any question and I know the answer I will help you. Just let your imagination go.