|
发表于 2009-12-24 08:51:19
|
显示全部楼层
Post by zhou3345;2058711
应该是配置的问题。
我现在也只用着默认配置。xmonad的配置文件让人看的云里雾里的,反正我到现在还没有搞清楚如何设置状态栏,以及控制置顶窗口。
不过尽管有这些不习惯,我还是忍了,毕竟速度一流,平铺也确实很方便。
用xmonad+lxpanel很久了, 没什么问题!
%xmonad --version
xmonad 0.9
%ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.4
%cat ~/.xmonad/xmonad.hs
- import XMonad
- import XMonad.Hooks.ManageDocks
- import XMonad.Hooks.EwmhDesktops
- import XMonad.Hooks.DynamicLog
- import XMonad.Hooks.ManageHelpers
- import XMonad.Util.Run(spawnPipe)
- --import XMonad.Util.EZConfig(additionalKeys)
- import XMonad.Layout.TwoPane
- import XMonad.Layout.WindowNavigation
- import qualified XMonad.StackSet as W
- import qualified Data.Map as M
- main = do
- xmonad $ defaultConfig
- { borderWidth = 1
- , focusedBorderColor = "#ff6666"
- , normalBorderColor = "#2222aa"
- , manageHook = manageHook defaultConfig <+> myManageHook
- , workspaces = map show [1 .. 10 :: Int]
- , terminal = "roxterm"
- , modMask = mod4Mask
- , focusFollowsMouse = True
- , startupHook = myStartupHook
- , logHook = myLogHook
- , layoutHook = windowNavigation $ avoidStruts $ (Mirror tall ||| tall ||| Full)
- --, layoutHook = ewmhDesktopsLayout $ windowNavigation $ avoidStruts $ (Mirror tall ||| tall ||| Full)
- , keys = \c -> myKeys c `M.union` keys defaultConfig c
- --, mouseBindings = \c -> myMouse c `M.union` mouseBindings defaultConfig c
- }
- where
- tall = Tall 1 (3/100) (1/2)
-
- myStartupHook :: X ()
- myStartupHook = do
- spawn "fcitx"
- spawn "roxterm"
- spawn "lxpanel"
- spawn "/home/sw2wolf/bin/kvm.sh"
- myLogHook :: X ()
- myLogHook = ewmhDesktopsLogHook
- myManageHook :: ManageHook
- myManageHook = composeAll . concat $
- [ [ className =? c --> doFloat | c <- myCFloats]
- ,[ className =? c --> doIgnore | c <- myIgnores]
- ,[ className =? "Audacious" --> doShift "3" ]
- ,[ className =? "Firefox" --> doF W.swapDown]
- ,[ resource =? r --> doFloat | r <- myRFloats]
- ,[ title =? t --> doFloat | t <- myTFloats]
- ,[(role =? "gimp-toolbox" <||> role =? "gimp-image-window") --> (ask >>= doF . W.sink)]
- ,[name =? n --> doCenterFloat | n <- myNames]
- ,[isFullscreen --> doFullFloat]]
- --,[ title >>= \t -> liftX (io $ writeFile "/tmp/lastWindowTitle" t) >> idHook ]
- where myCFloats = ["Shredder", "GQview", "MPlayer", "Gimp","Vncviewer","Xmessage","Google","Pidgin"]
- myRFloats = ["Dialog", "Download", "Places"]
- myTFloats = ["Firefox Preferences", "Element Properties", "VLC"]
- myIgnores = ["trayer"]
- myNames = ["bashrun","Google Chrome Options","R Graphics: Device 2 (ACTIVE)"]
- role = stringProperty "WM_WINDOW_ROLE"
- name = stringProperty "WM_NAME"
- myKeys (XConfig {modMask = modm}) = M.fromList $
- -- Apps and tools
- [ ((modm, xK_F2), spawn "gmrun")
- , ((modm, xK_f), spawn "/home/firefox/firefox")
- , ((modm, xK_t), spawn "thunderbird")
- --, ((modm, xK_p), spawn "exe=`dmenu_path | dmenu -b` && eval "exec $exe"")
- , ((modm, xK_F11), spawn "sudo shutdown -r now")
- , ((modm, xK_F12), spawn "sudo shutdown -h now")
- , ((modm .|. controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
- , ((modm, xK_Print), spawn "scrot '/tmp/%Y-%m-%d_%H:%M:%S_$wx$h_scrot.png' -e 'mv $f ~'")
- , ((modm, xK_c), kill)
- -- Window Navigation
- , ((modm, xK_Right), sendMessage $ Go R)
- , ((modm, xK_Left ), sendMessage $ Go L)
- , ((modm, xK_Up ), sendMessage $ Go U)
- , ((modm, xK_Down ), sendMessage $ Go D)
- -- swap...
- , ((modm .|. controlMask, xK_Right), sendMessage $ Swap R)
- , ((modm .|. controlMask, xK_Left ), sendMessage $ Swap L)
- , ((modm .|. controlMask, xK_Up ), sendMessage $ Swap U)
- , ((modm .|. controlMask, xK_Down ), sendMessage $ Swap D)
- ]
复制代码 |
|