-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmonad.hs
98 lines (83 loc) · 3.24 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
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import System.IO
import XMonad.Actions.GridSelect
import XMonad.Util.NamedScratchpad
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import XMonad.Actions.WindowGo(runOrRaise)
import XMonad.Util.EZConfig(additionalKeys, additionalKeysP)
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.SetWMName(setWMName)
import XMonad.Layout.Maximize(maximize, maximizeRestore)
import XMonad.Layout.ThreeColumns
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
import XMonad.Prompt
import XMonad.Layout.Grid
-- MyManage hooks defines floating windows
-- and which application is started on which workspace
--
myManageHook = composeAll . concat $
[ [ className =? c --> doFloat | c <- myFloats]
, [ className =? c --> doShift "1:web" | c <- ws1]
, [ className =? c --> doShift "2:im" | c <- ws2]
]
where
myFloats = [ "AfterShotPro","Dialog", "Gcalctool", "VirtualBox", "Vncviewer"
, "Gnome-display-properties", "Eclipse"
, "javax.swing.JDialog", "Downloads"
]
ws1 = ["Firefox"]
ws2 = ["Pidgin"]
-- defines possible layouts to be switched from
--
myLayout = maximize tiled
||| maximize (Mirror tiled)
||| maximize Full
||| maximize columns3
||| maximize Grid
where
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 1/2
delta = 3/100
columns3 = ThreeColMid 1 (3/100) (2/3)
-- Scratchpads
scratchpads =
[ NS "stalonetray" "stalonetray" (className =? "stalonetray" ) defaultFloating
, NS "nm-connection-editor" "nm-connection-editor" (className =? "Nm-connection-editor" ) defaultFloating
, NS "XMind" "XMind" (className =? "XMind" ) defaultFloating
, NS "evolution" "evolution" (className =? "Evolution" ) defaultFloating
, NS "pavucontrol" "pavucontrol" (className =? "Pavucontrol" ) defaultFloating
, NS "stardict" "stardict" (className =? "Stardict")
(customFloating $ W.RationalRect (2/5) (2/5) (1/2) (1/2))
] where role = stringProperty "WM_WINDOW_ROLE"
main = do
xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/xmobarrc"
xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
{ manageHook = namedScratchpadManageHook scratchpads <+> manageDocks <+> myManageHook <+> manageHook defaultConfig
--, startupHook = setWMName "LG3D"
, layoutHook = avoidStruts $ smartBorders (myLayout) -- smartBorders assure no borders in fullscreen (Mplayer - neede fstype=none in ~/.mplayer/config
, borderWidth = 2
, workspaces = [ "1:web", "2:im", "3:terms", "4:notes" ] ++ map show [5..8] ++ [ "9:media" ]
, terminal = "gnome-terminal"
, modMask = mod4Mask
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "red" "" . shorten 50
, ppHiddenNoWindows = id
}
} `additionalKeysP`
[ ("M-C-f", spawn "firefox -P default")
, ("M-C-s", namedScratchpadAction scratchpads "stardict")
, ("M-C-m", namedScratchpadAction scratchpads "evolution")
, ("M-v", namedScratchpadAction scratchpads "pavucontrol")
, ("M-z", namedScratchpadAction scratchpads "XMind")
, ("M-C-S-c", spawn "setxkbmap cz")
, ("M-C-S-e", spawn "setxkbmap us")
, ("M-C-l", spawn "xlock -mode blank")
, ("M-.", goToSelected defaultGSConfig)
]