xmonad @ubuntu 10.04

Like the Big workspace in Xmonad. I think it is very suitable for programmers .

1. Install the Xmonad .
2.
~/.xmonad/xmonad.hs

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.WorkspaceCompare
import System.IO
 
myManageHook = composeAll
[ className =? "Gimp"      -->; doFloat
, className =? "Vncviewer" -->; doFloat
]
 
main = do
xmproc <;- spawnPipe "xmobar"
xmonad $ defaultConfig
{ manageHook = manageDocks <;+> myManageHook -- make sure to include myManageHook definition from above
<;+> manageHook defaultConfig
, layoutHook = avoidStruts  $  layoutHook defaultConfig
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
, modMask = mod4Mask     -- Rebind Mod to the Windows key
} `additionalKeys`
[((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
, ((mod4Mask, xK_semicolon), sendMessage Expand)
 
]

由于super+l用来expand 主窗口的键跟windows下的锁定冲突,所以我又设置了super+;也就是L键右面那个做为expand主窗口键。并且这里把Alt键改成了Super键,也是由于冲突的原因。

xmobar – ~/.xmobarrc

Config { font = “-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*”
, bgColor = “black”
, fgColor = “grey”
, position = TopW L 85
, commands = [ Run Network "wlan0" ["-L","0","-H","32","--normal","green","--high","red"] 10
, Run Cpu ["-L","15","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: %"] 10
, Run Swap [] 10
, Run Date “%a %b %_d %Y %H:%M:%S” “date” 10
, Run StdinReader
]
, sepChar = “%”
, alignSep = “}{”
, template = “%StdinReader% }{ %cpu% | %memory% * %swap% | %wlan0% | %date%”
}

gdm – /usr/share/xsessions/xmonad.desktop

[Desktop Entry]
Encoding=UTF-8
Name=XMonad
Comment=Leightweight tiling window manager
Exec=xmonad.start
Icon=xmonad.png
Type=XSession

xmonad.start is a custom script.

xmonad.start – /usr/local/bin/xmonad.start

#!/bin/bash
 
xrdb -merge .Xresources
 
trayer –edge top –align right –SetDockType true –SetPartialStrut true –expand true –width 15 –height 12 –transparent true –tint 0×000000 &;
gnome-screensaver
 
gnome-settings-daemon
 
if [ -x /usr/bin/gnome-power-manager ] ; then
sleep 1
gnome-power-manager
fi
 
if [ -x /usr/bin/nm-applet ] ; then
nm-applet –sm-disable &;
fi
 
kmix –keepvisibility
 
#feh –bg-scale /mnt/archivio/foto/2008-2009-dublino/2009-04-10-stefano/hapenny-desktop.jpg &;
exec xmonad
 

最后我再把windowmanager从metacity设成xmonad,就完成了。

   1: $ gconftool-2 -t string -s /desktop/gnome/applications/window_manager/current xmonad
   2: $ gconftool-2 -t string -s /desktop/gnome/session/required_components/windowmanager xmonad

also, here is a step-by-step config

http://haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen%27s_Configuration

and here is a config archive .

http://haskell.org/haskellwiki/Xmonad/Config_archive

Enjoy.

posted @ 2010-06-26 20:03  冷月X  阅读(1490)  评论(0编辑  收藏  举报