Personal tools

Xmonad/Config archive/TeXitoi's xmonad.hs

From HaskellWiki

< Xmonad | Config archive(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
 
<haskell>
 
<haskell>
 
import XMonad
 
import XMonad
import XMonad.Hooks.ManageDocks
+
import XMonad.Config.Desktop
import XMonad.Hooks.EwmhDesktops
+
import XMonad.Hooks.FadeInactive
 
import XMonad.Layout.NoBorders
 
import XMonad.Layout.NoBorders
  +
import XMonad.Hooks.SetWMName
  +
import qualified XMonad.Layout.HintedTile as HT
   
 
import qualified Data.Map as M
 
import qualified Data.Map as M
Line 12: Line 14:
 
main = xmonad defaults
 
main = xmonad defaults
   
defaults = defaultConfig {
+
defaults = desktopConfig {
terminal = "urxvtc",
+
modMask = mod4Mask,
modMask = mod4Mask,
+
terminal = "urxvtc",
keys = \c -> mykeys c `M.union` keys defaultConfig c,
+
keys = \c -> mykeys c `M.union` keys desktopConfig c,
manageHook = manageDocks <+> manageHook defaultConfig,
+
logHook = logHook desktopConfig >> fadeInactiveLogHook 0xcccccccc >> setWMName "LG3D",
logHook = ewmhDesktopsLogHook,
+
layoutHook = desktopLayoutModifiers . smartBorders $ tiled ||| Full,
layoutHook = smartBorders $ ewmhDesktopsLayout $ avoidStruts $ layoutHook defaultConfig,
+
workspaces = map show [1..8],
workspaces = map show [1..8],
+
focusedBorderColor = "#729fcf",
focusedBorderColor = "#729fcf",
+
normalBorderColor = "#aaaaaa"
normalBorderColor = "#aaaaaa",
+
}
borderWidth = 2
+
} where
+
tiled = HT.HintedTile nmaster delta ratio HT.TopLeft HT.Tall where
mykeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
+
nmaster = 1
[((modMask, xK_b), sendMessage ToggleStruts),
+
ratio = 1/2
((modMask, xK_semicolon), sendMessage (IncMasterN (-1)))]
+
delta = 3/100
++
+
[((m .|. modMask, k), windows $ f i)
+
mykeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
| (i, k) <- zip (XMonad.workspaces conf) [0x26,0xe9,0x22,0x27,0x28,0x2d,0xe8,0x5f,0xe7,0xe0],
+
[((mod1Mask, xK_Tab), windows W.focusDown),
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
+
((mod1Mask .|. shiftMask, xK_Tab), windows W.focusUp),
  +
((mod4Mask, xK_i), sendMessage NextLayout)]
  +
++
  +
[((m .|. modMask, 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]
 
</haskell>
 
</haskell>

Revision as of 17:50, 12 March 2010

import XMonad
import XMonad.Config.Desktop
import XMonad.Hooks.FadeInactive
import XMonad.Layout.NoBorders
import XMonad.Hooks.SetWMName
import qualified XMonad.Layout.HintedTile as HT
 
import qualified Data.Map as M
import qualified XMonad.StackSet as W
import Data.Bits ((.|.))
 
main = xmonad defaults
 
defaults = desktopConfig {
    modMask = mod4Mask,
    terminal = "urxvtc",
    keys = \c -> mykeys c `M.union` keys desktopConfig c,
    logHook = logHook desktopConfig >> fadeInactiveLogHook 0xcccccccc >> setWMName "LG3D",
    layoutHook = desktopLayoutModifiers . smartBorders $ tiled ||| Full,
    workspaces = map show [1..8],
    focusedBorderColor = "#729fcf",
    normalBorderColor = "#aaaaaa"
}
 
tiled = HT.HintedTile nmaster delta ratio HT.TopLeft HT.Tall where
    nmaster = 1
    ratio = 1/2
    delta = 3/100
 
mykeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    [((mod1Mask, xK_Tab), windows W.focusDown),
     ((mod1Mask .|. shiftMask, xK_Tab), windows W.focusUp),
     ((mod4Mask, xK_i), sendMessage NextLayout)]
    ++
    [((m .|. modMask, 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]