-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmonad.hs
64 lines (58 loc) · 2.03 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
import System.IO
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.Replace
import XMonad.Util.Run(spawnPipe)
import qualified XMonad.StackSet as W
xF86AudioRaiseVolume,xF86AudioLowerVolume,xF86AudioMute :: KeySym
xF86AudioRaiseVolume = 0x1008ff13
xF86AudioLowerVolume = 0x1008ff11
xF86AudioMute = 0x1008ff12
myLayout = avoidStruts $ smartBorders $ tiled ||| Mirror tiled ||| Full
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
myManageHook = composeAll
[ isFullscreen --> (doF W.focusDown <+> doFullFloat)
, manageDocks
, manageHook defaultConfig
]
main = do
replace
xmproc <- spawnPipe "xmobar ~/.xmobarrc"
xmonad $ defaultConfig
{ terminal = "terminal"
, modMask = mod4Mask
, focusFollowsMouse = True
, borderWidth = 1
, manageHook = myManageHook
, layoutHook = myLayout
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 100
}
} `additionalKeys` myKeys
myKeys =
[ ((modMask .|. shiftMask, xK_l), spawn "xscreensaver-command -lock")
, ((0, xF86AudioMute), spawn "amixer -q set Master toggle")
, ((0, xF86AudioLowerVolume), spawn "amixer -q set Master 5%-")
, ((0, xF86AudioRaiseVolume), spawn "amixer -q set Master 5%+")
, ((modMask, xK_p), spawn "dmenu_run")
, ((modMask .|. shiftMask, xK_p), spawn "dmenu_run")
]
++
[((m .|. modMask, k), windows $ f i)
| (i, k) <- zip (workspaces defaultConfig) [xK_1 .. xK_9]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]
]
where modMask = mod4Mask