-
Notifications
You must be signed in to change notification settings - Fork 2
/
xmonad.hs
92 lines (77 loc) · 3.25 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
{-------------------------------------------------------------------------------
Stolen from Chris P.
-------------------------------------------------------------------------------}
import XMonad
import XMonad.Actions.WindowGo
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Hooks.UrgencyHook
import XMonad.Layout.Gaps
import XMonad.Layout.NoBorders
import XMonad.Layout.Spacing
import XMonad.Util.EZConfig
import XMonad.Util.Run
import XMonad.Util.Scratchpad
import System.IO
{-------------------------------------------------------------------------------
Main
-------------------------------------------------------------------------------}
main = do
xmonad conf
{
startupHook = startupHook conf >> setWMName "LG3D"
}
conf = withUrgencyHook NoUrgencyHook $ ewmh defaultConfig
{ terminal = "urxvt"
, modMask = mod4Mask
, focusedBorderColor = "gray80"
, normalBorderColor = "gray20"
-- Shouldn't need gaps, but xmonad or tint2 are not respecting struts
, layoutHook = avoidStruts . smartBorders . gaps [(U,25)] $ layoutHook defaultConfig
, manageHook = manageHook defaultConfig <+> manageDocks
}
`removeKeysP` keysToRemove
`additionalKeysP` keysToAdd
{-------------------------------------------------------------------------------
Key Bindings
-------------------------------------------------------------------------------}
-- Additional key bindings to add to the default configuration
keysToAdd =
[ ("M-<Space>", spawn dmenuCmd)
, ("M-\\", sendMessage NextLayout)
, ("M-s", scratchpadSpawnActionTerminal "urxvt")
, ("M-f", runOrRaise "firefox" (className =? "Namoroka"))
, ("M-i", raiseMaybe (runInTerm "-title irssi" "sh -c 'irssi'") (title =? "irssi"))
, ("M-C-l", spawn "xscreensaver-command -lock")
, ("<XF86AudioMute>", spawn "amixer -q set Master toggle")
, ("<XF86AudioLowerVolume>", spawn "amixer -q set Master 2dB- unmute")
, ("<XF86AudioRaiseVolume>", spawn "amixer -q set Master 2dB+ unmute")
, ("<XF86AudioStop>", spawn "mpc stop")
, ("<XF86AudioPlay>", spawn "mpc toggle")
, ("<XF86AudioPrev>", spawn "mpc prev")
, ("<XF86AudioNext>", spawn "mpc next")
, ("<XF86ScreenSaver>", spawn "xscreensaver-command -l")
]
-- Key bindings to remove from the default configuration
keysToRemove =
[ "M-p"
, "M-<Space>"
]
{-------------------------------------------------------------------------------
External Processes
-------------------------------------------------------------------------------}
dmenuCmd = "dmenu_run -fn " ++ quoteStr defaultFont
{-------------------------------------------------------------------------------
Fonts
-------------------------------------------------------------------------------}
--defaultFont = terminusFont
defaultFont = helveticaFont
helveticaFont = "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*"
--terminusFont = "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-*"
{-------------------------------------------------------------------------------
Helpers
-------------------------------------------------------------------------------}
quoteStr = wrap "'" "'"