forked from majnemer/davesdots
-
Notifications
You must be signed in to change notification settings - Fork 1
/
xmonad.hs
70 lines (58 loc) · 2.11 KB
/
xmonad.hs
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
import XMonad
import qualified XMonad.StackSet as W
import XMonad.Actions.CycleWS
import XMonad.Layout.Grid
import XMonad.Layout.Tabbed
import XMonad.Layout.NoBorders(smartBorders)
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeysP)
import XMonad.Util.Scratchpad
import XMonad.Prompt
import XMonad.Prompt.Shell(shellPrompt)
import XMonad.Prompt.Window
import System.IO(hPutStrLn)
-- Things that should always float
myFloatHook = composeAll [
className =? "qemu" --> doFloat
]
myLayoutHook = tiled ||| Mirror tiled ||| Grid ||| simpleTabbed
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 1/2
-- Percent of screen to increment by when resizing panes
delta = 3/100
main = do
xmproc <- spawnPipe "~/bin/xmobar"
xmonad $ withUrgencyHook NoUrgencyHook defaultConfig
{ manageHook = manageDocks <+> myFloatHook <+> manageHook defaultConfig <+> scratchpadManageHook (W.RationalRect 0.25 0.25 0.5 0.5)
, layoutHook = avoidStruts $ smartBorders $ myLayoutHook
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppUrgent = xmobarColor "#CC0000" "" . wrap "**" "**"
, ppTitle = xmobarColor "#8AE234" ""
}
, terminal = "xterm"
}
`additionalKeysP`
[ ("M-p", shellPrompt defaultXPConfig { position = Top })
, ("M-S-a", windowPromptGoto defaultXPConfig { position = Top })
, ("M-a", windowPromptBring defaultXPConfig { position = Top })
, ("M-S-l", spawn "~/bin/lock")
, ("M-S-<Left>", shiftToPrev)
, ("M-S-<Right>", shiftToNext)
, ("M-<Up>", windows W.focusUp)
, ("M-S-<Up>", windows W.swapUp)
, ("M-<Down>", windows W.focusDown)
, ("M-S-<Down>", windows W.swapDown)
, ("M-`", toggleWS)
, ("M-s", moveTo Next EmptyWS)
, ("M-S-s", shiftTo Next EmptyWS)
, ("M-g", scratchpadSpawnAction defaultConfig { terminal = "xterm" })
]