summaryrefslogtreecommitdiffstats
path: root/xmonad-0.7.hs
blob: 4a8443ae4ad5b9e9bf5eaa398fe6ff748b27cf92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import XMonad
import System.Exit
 
import qualified XMonad.StackSet as W
import qualified Data.Map        as M
 
myTerminal = "x-terminal-emulator"
myBorderWidth = 1
myModMask = mod1Mask
myNumlockMask = mod2Mask
myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
myNormalBorderColor = "#dddddd"
myFocusedBorderColor = "#ff0000"
 
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    [ ((modMask,               xK_Return), spawn $ XMonad.terminal conf)
    , ((modMask,               xK_q     ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
    , ((modMask,               xK_l     ), spawn "xscreensaver-command -lock")
    , ((modMask .|. shiftMask, xK_c     ), kill)
    , ((modMask,               xK_space ), sendMessage NextLayout)
    , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
    , ((modMask,               xK_r     ), windows W.focusDown)
    , ((modMask,               xK_g     ), windows W.focusUp  )
    , ((modMask,               xK_m     ), windows W.focusMaster  )
    , ((modMask .|. shiftMask, xK_r     ), windows W.swapDown  )
    , ((modMask .|. shiftMask, xK_g     ), windows W.swapUp    )
    , ((modMask,               xK_n     ), sendMessage Shrink)
    , ((modMask,               xK_t     ), sendMessage Expand)
    , ((modMask,               xK_h     ), withFocused $ windows . W.sink)
    , ((modMask,               xK_comma ), sendMessage (IncMasterN 1))
    , ((modMask,               xK_period), sendMessage (IncMasterN (-1)))
    , ((modMask,               xK_k     ), spawn "amixer -c 0 set PCM 2dB+")
    , ((modMask,               xK_s     ), spawn "amixer -c 0 set PCM 2dB-")
    ]
    ++

    [((m .|. modMask, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]

myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
    [ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w))
    , ((modMask, button2), (\w -> focus w >> windows W.swapMaster))
    , ((modMask, button3), (\w -> focus w >> mouseResizeWindow w))
    ]
 
myLayout = tiled ||| Mirror tiled ||| Full
  where
     tiled   = Tall nmaster delta ratio
     nmaster = 1
     ratio   = 55/100
     delta   = 1/100
 
myManageHook = composeAll
    [ className =? "MPlayer"        --> doFloat
    , className =? "Skype"          --> doFloat
    , className =? "Twinkle"        --> doFloat
    , className =? "VirtualBox"     --> doFloat
    , className =? "Gimp"           --> doFloat
    , className =? "Qemu-launcher"  --> doFloat
    , className =? "Default - Wine desktop"  --> doFloat
    ]
 
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
 
myLogHook = return ()

main = xmonad defaults

defaults = defaultConfig {
        terminal           = myTerminal,
        focusFollowsMouse  = myFocusFollowsMouse,
        borderWidth        = myBorderWidth,
        modMask            = myModMask,
        numlockMask        = myNumlockMask,
        workspaces         = myWorkspaces,
        normalBorderColor  = myNormalBorderColor,
        focusedBorderColor = myFocusedBorderColor,
 
        keys               = myKeys,
        mouseBindings      = myMouseBindings,
 
        layoutHook         = myLayout,
        manageHook         = myManageHook,
        logHook            = myLogHook
    }