Difference between revisions of "Xmonad/Config archive/TeXitoi's xmonad.hs"

From HaskellWiki
Jump to navigation Jump to search
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:XMonad configuration]]
 
[[Category:XMonad configuration]]
 
<haskell>
 
<haskell>
import XMonad
+
import XMonad hiding (Tall)
 
import XMonad.Config.Desktop
 
import XMonad.Config.Desktop
 
import XMonad.Hooks.FadeInactive
 
import XMonad.Hooks.FadeInactive
 
import XMonad.Hooks.SetWMName
 
import XMonad.Hooks.SetWMName
 
import XMonad.Layout.NoBorders
 
import XMonad.Layout.NoBorders
import qualified XMonad.Layout.HintedTile as HT
+
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 desktopConfig {
 
main = xmonad desktopConfig {
 
modMask = mod4Mask,
 
modMask = mod4Mask,
 
terminal = "urxvtc",
 
terminal = "urxvtc",
keys = \c -> mykeys c `M.union` keys desktopConfig c,
+
keys = \c -> myKeys c `M.union` keys desktopConfig c,
logHook = logHook desktopConfig >> fadeInactiveLogHook 0xcccccccc >> setWMName "LG3D",
+
startupHook = startupHook desktopConfig >> setWMName "LG3D",
  +
logHook = logHook desktopConfig >> fadeInactiveLogHook 0xcccccccc,
 
layoutHook = desktopLayoutModifiers . smartBorders $ tiled ||| Full,
 
layoutHook = desktopLayoutModifiers . smartBorders $ tiled ||| Full,
  +
manageHook = myManageHook <+> manageHook desktopConfig,
 
workspaces = map show [1..8],
 
workspaces = map show [1..8],
 
focusedBorderColor = "#729fcf",
 
focusedBorderColor = "#729fcf",
Line 22: Line 23:
 
}
 
}
   
tiled = HT.HintedTile nmaster delta ratio HT.TopLeft HT.Tall where
+
tiled = HintedTile 1 0.03 0.5 TopLeft Tall
nmaster = 1
 
ratio = 1/2
 
delta = 3/100
 
   
mykeys conf@(XConfig {modMask = modm}) = M.fromList $
+
myKeys conf@(XConfig {modMask = modm}) = M.fromList $
[((mod1Mask, xK_Tab), windows W.focusDown),
+
[((modm, xK_semicolon), sendMessage (IncMasterN (-1))),
  +
((mod1Mask, xK_Tab), windows W.focusDown),
 
((mod1Mask .|. shiftMask, xK_Tab), windows W.focusUp),
 
((mod1Mask .|. shiftMask, xK_Tab), windows W.focusUp),
((mod4Mask, xK_i), sendMessage NextLayout)]
+
((mod4Mask, xK_i), sendMessage NextLayout)] ++
  +
[((m .|. modm, k), windows $ f i)
++
 
[((m .|. modm, k), windows $ f i) |
+
| (i, k) <- zip (workspaces conf) numBepo,
(i, k) <- zip (workspaces conf) numbepo,
+
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
 
   
numbepo = [0x22,0xab,0xbb,0x28,0x29,0x40,0x2b,0x2d,0x2f,0x2a]
+
numBepo = [0x22,0xab,0xbb,0x28,0x29,0x40,0x2b,0x2d,0x2f,0x2a]
numazerty = [0x26,0xe9,0x22,0x27,0x28,0x2d,0xe8,0x5f,0xe7,0xe0]
+
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"])]
 
</haskell>
 
</haskell>

Revision as of 16:56, 30 May 2010

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"])]