-
Notifications
You must be signed in to change notification settings - Fork 1
/
xmonad.hs
139 lines (127 loc) · 4.22 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import XMonad
import XMonad.Hooks.SetWMName
import XMonad.Layout.Grid
import XMonad.Layout.ResizableTile
import XMonad.Layout.ThreeColumns
import XMonad.Layout.NoBorders
import XMonad.Layout.Circle
import XMonad.Layout.PerWorkspace (onWorkspace)
import XMonad.Layout.Fullscreen
import XMonad.Layout.Tabbed
import XMonad.Util.EZConfig
import XMonad.Util.Run
import XMonad.Hooks.DynamicLog
import XMonad.Actions.Plane
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ICCCMFocus
import XMonad.Config.Desktop
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import Data.Ratio ((%))
myModMask = mod4Mask
myFocusedBorderColor = "#00cb00"
myNormalBorderColor = "#cccccc"
myBorderWidth = 1
myTerminal = "xterm"
myTitleColor = "#eeeeee"
myTitleLength = 30
myCurrentWSColor = "#e6744c"
myCurrentWSLeft = "["
myCurrentWSRight = "]"
myWorkspaces =
[
"1", "2", "3", "4", "5", "6", "7", "8", "9"
]
startupWorkspace = "1"
defaultLayouts = smartBorders(avoidStruts(
ResizableTall 1 (3/100) (1/2) []
||| Mirror (ResizableTall 1 (3/100) (1/2) [])
||| noBorders Full
||| tabbed shrinkText defaultTheme))
||| ThreeColMid 1 (3/100) (1/3)
gimpLayout = smartBorders(avoidStruts(ThreeColMid 1 (3/100) (3/4)))
myLayouts =
onWorkspace "9" gimpLayout
$ defaultLayouts
myKeyBindings =
[
((myModMask, xK_b), sendMessage ToggleStruts)
, ((myModMask, xK_a), sendMessage MirrorShrink)
, ((myModMask, xK_z), sendMessage MirrorExpand)
, ((myModMask, xK_x), spawn "synapse")
, ((myModMask .|. mod1Mask, xK_space), spawn "synapse")
, ((myModMask .|. shiftMask, xK_t), spawn "xkill")
, ((myModMask .|. shiftMask, xK_g), spawn "gimp")
, ((myModMask .|. shiftMask, xK_n), spawn "nautilus --no-desktop")
, ((0, 0x1008FF12), spawn "amixer -D pulse set Master toggle")
, ((0, 0x1008FF11), spawn "~/.xmonad/set-volume down")
, ((0, 0x1008FF13), spawn "~/.xmonad/set-volume up")
, ((0, 0x1008ffb2), spawn "mictoggle")
, ((0, 0x1008ff14), spawn "mocp -G")
, ((0, 0x1008ff30), spawn "gnome-screensaver-command -l")
, ((0, 0x1008ff02), spawn "xbacklight -inc 7")
, ((0, 0x1008ff03), spawn "xbacklight -dec 7")
, ((0, 0x1008ff1d), spawn "gnome-calculator")
, ((0, xK_Print), spawn "shutter -s")
]
myManagementHooks :: [ManageHook]
myManagementHooks = [
resource =? "synapse" --> doIgnore
, resource =? "stalonetray" --> doIgnore
, (className =? "Gimp-2.8") --> doF (W.shift "9")
]
numPadKeys =
[
xK_KP_Home, xK_KP_Up, xK_KP_Page_Up
, xK_KP_Left, xK_KP_Begin,xK_KP_Right
, xK_KP_End, xK_KP_Down, xK_KP_Page_Down
, xK_KP_Insert, xK_KP_Delete, xK_KP_Enter
]
numKeys =
[
xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_9
]
myKeys = myKeyBindings ++
[
((m .|. myModMask, k), windows $ f i)
| (i, k) <- zip myWorkspaces numPadKeys
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
] ++
[
((m .|. myModMask, k), windows $ f i)
| (i, k) <- zip myWorkspaces numKeys
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
] ++
M.toList (planeKeys myModMask (Lines 4) Finite) ++
[
((m .|. myModMask, key), screenWorkspace sc
>>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_w, xK_e, xK_r] [1,0,2]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]
]
main = do
xmproc <- spawnPipe "xmobar ~/.xmonad/xmobarrc"
xmonad $ desktopConfig {
terminal = myTerminal
, focusedBorderColor = myFocusedBorderColor
, normalBorderColor = myNormalBorderColor
, borderWidth = myBorderWidth
, layoutHook = desktopLayoutModifiers $ myLayouts
, workspaces = myWorkspaces
, modMask = myModMask
, handleEventHook = handleEventHook desktopConfig
, startupHook = do
setWMName "LG3D"
windows $ W.greedyView startupWorkspace
spawn "~/.xmonad/startup-hook"
, manageHook = manageHook desktopConfig
<+> composeAll myManagementHooks
<+> manageDocks
, logHook = takeTopFocus <+> dynamicLogWithPP xmobarPP {
ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor myTitleColor "" . shorten myTitleLength
, ppCurrent = xmobarColor myCurrentWSColor ""
. wrap myCurrentWSLeft myCurrentWSRight
}
}
`additionalKeys` myKeys