Personal tools

Xmonad/Config archive/TeXitoi's xmonad.hs

From HaskellWiki

< Xmonad | Config archive(Difference between revisions)
Jump to: navigation, search
Current revision (16:56, 30 May 2010) (edit) (undo)
 
(7 intermediate revisions not shown.)
Line 1: Line 1:
[[Category:XMonad configuration]]
[[Category:XMonad configuration]]
<haskell>
<haskell>
 +
import XMonad hiding (Tall)
 +
import XMonad.Config.Desktop
 +
import XMonad.Hooks.FadeInactive
 +
import XMonad.Hooks.SetWMName
 +
import XMonad.Layout.NoBorders
 +
import XMonad.Layout.HintedTile
import qualified Data.Map as M
import qualified Data.Map as M
import qualified XMonad.StackSet as W
import qualified XMonad.StackSet as W
-
import Data.Bits ((.|.))
 
-
main = xmonad defaults
+
main = xmonad desktopConfig {
 +
modMask = mod4Mask,
 +
terminal = "urxvtc",
 +
keys = \c -> myKeys c `M.union` keys desktopConfig c,
 +
startupHook = startupHook desktopConfig >> setWMName "LG3D",
 +
logHook = logHook desktopConfig >> fadeInactiveLogHook 0xcccccccc,
 +
layoutHook = desktopLayoutModifiers . smartBorders $ tiled ||| Full,
 +
manageHook = myManageHook <+> manageHook desktopConfig,
 +
workspaces = map show [1..8],
 +
focusedBorderColor = "#729fcf",
 +
normalBorderColor = "#aaaaaa"
 +
}
-
defaults = defaultConfig {
+
tiled = HintedTile 1 0.03 0.5 TopLeft Tall
-
terminal = "urxvtc",
+
 
-
modMask = mod4Mask,
+
myKeys conf@(XConfig {modMask = modm}) = M.fromList $
-
keys = \c -> mykeys c `M.union` keys defaultConfig c,
+
[((modm, xK_semicolon), sendMessage (IncMasterN (-1))),
-
manageHook = manageDocks <+> manageHook defaultConfig,
+
((mod1Mask, xK_Tab), windows W.focusDown),
-
logHook = ewmhDesktopsLogHook,
+
((mod1Mask .|. shiftMask, xK_Tab), windows W.focusUp),
-
layoutHook = ewmhDesktopsLayout $ avoidStruts $ layoutHook defaultConfig,
+
((mod4Mask, xK_i), sendMessage NextLayout)] ++
-
workspaces = ["1","2","3","4","5","6","7","8"],
+
[((m .|. modm, k), windows $ f i)
-
focusedBorderColor = "#729fcf",
+
| (i, k) <- zip (workspaces conf) numBepo,
-
normalBorderColor = "#aaaaaa",
+
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
-
borderWidth = 2
+
 
-
} where
+
numBepo = [0x22,0xab,0xbb,0x28,0x29,0x40,0x2b,0x2d,0x2f,0x2a]
-
mykeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
+
numAzerty = [0x26,0xe9,0x22,0x27,0x28,0x2d,0xe8,0x5f,0xe7,0xe0]
-
[((modMask, xK_b), sendMessage ToggleStruts),
+
 
-
((modMask, xK_semicolon), sendMessage (IncMasterN (-1)))]
+
myManageHook = composeAll [className =? c --> doShift w | (w, cs) <- wcs, c <- cs]
-
++
+
where wcs = [("2", ["Midori", "Firefox"]),
-
[((m .|. modMask, k), windows $ f i)
+
("3", ["Gajim.py"]),
-
| (i, k) <- zip (XMonad.workspaces conf) [0x26,0xe9,0x22,0x27,0x28,0x2d,0xe8,0x5f,0xe7,0xe0],
+
("4", ["Claws-mail"]),
-
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
+
("5", ["Gmpc"])]
</haskell>
</haskell>

Current revision

import XMonad hiding (Tall)
import XMonad.Config.Desktop
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.SetWMName
import XMonad.Layout.NoBorders
import XMonad.Layout.HintedTile
import qualified Data.Map as M
import qualified XMonad.StackSet as W
 
main = xmonad desktopConfig {
    modMask = mod4Mask,
    terminal = "urxvtc",
    keys = \c -> myKeys c `M.union` keys desktopConfig c,
    startupHook = startupHook desktopConfig >> setWMName "LG3D",
    logHook = logHook desktopConfig >> fadeInactiveLogHook 0xcccccccc,
    layoutHook = desktopLayoutModifiers . smartBorders $ tiled ||| Full,
    manageHook = myManageHook <+> manageHook desktopConfig,
    workspaces = map show [1..8],
    focusedBorderColor = "#729fcf",
    normalBorderColor = "#aaaaaa"
}
 
tiled = HintedTile 1 0.03 0.5 TopLeft Tall
 
myKeys conf@(XConfig {modMask = modm}) = M.fromList $
    [((modm, xK_semicolon), sendMessage (IncMasterN (-1))),
     ((mod1Mask, xK_Tab), windows W.focusDown),
     ((mod1Mask .|. shiftMask, xK_Tab), windows W.focusUp),
     ((mod4Mask, xK_i), sendMessage NextLayout)] ++
    [((m .|. modm, k), windows $ f i)
        | (i, k) <- zip (workspaces conf) numBepo,
          (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
 
numBepo = [0x22,0xab,0xbb,0x28,0x29,0x40,0x2b,0x2d,0x2f,0x2a]
numAzerty = [0x26,0xe9,0x22,0x27,0x28,0x2d,0xe8,0x5f,0xe7,0xe0]
 
myManageHook = composeAll [className =? c --> doShift w | (w, cs) <- wcs, c <- cs]
    where wcs = [("2", ["Midori", "Firefox"]),
                 ("3", ["Gajim.py"]),
                 ("4", ["Claws-mail"]),
                 ("5", ["Gmpc"])]