-- xmonad hs import Data Bits import Graphics X11 import qualified Dat

  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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
-- xmonad.hs
import Data.Bits ((.|.))
import Graphics.X11
import qualified Data.Map as M
import qualified XMonad.StackSet as W
import Data.Ratio ((%))
import System.Exit
import System.IO (hPutStrLn)
import XMonad.Actions.DwmPromote
import XMonad.Actions.FloatKeys
import XMonad.Actions.Submap
import XMonad.Actions.SwapWorkspaces
import XMonad hiding ((|||))
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Hooks.UrgencyHook
import XMonad.Layout.Accordion
import XMonad.Layout.IM
import XMonad.Layout.LayoutCombinators
import XMonad.Layout.Named
import XMonad.Layout.NoBorders
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Reflect
import XMonad.Layout.Tabbed
import XMonad.Layout.ToggleLayouts
import XMonad.ManageHook
import XMonad.Operations
import XMonad.Util.EZConfig (additionalKeysP)
import XMonad.Util.Run (spawnPipe)
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.XMonad
myTerminal = "konsole"
statusBarCmd = "xmobar"
tabbedConf = defaultTheme { fontName = "xft:Consolas-8" }
myWorkspaces = ["term","im","firefox","thunderbird","servers","virtualbox","7","8","9"]
myNormalBorderColor = "#444488"
myFocusedBorderColor = "#ee9999"
myBgColor= "#001070"
myFgColor = "#bbbbdd"
myBgHLight= "#4444aa"
myFgHLight= "#ddddff"
myXPConfig :: XPConfig
myXPConfig = defaultXPConfig
{ font = "xft:Bitstream Vera Sans:pixelsize=13"
, bgColor = myBgColor
, fgColor = myFgColor
, bgHLight = myBgHLight
, fgHLight = myFgHLight
, borderColor = myNormalBorderColor
}
addKeys =
[ ("M-b" , sendMessage ToggleStruts)
, ("C-M-<Page_Up>" , spawn "mpc prev")
, ("C-M-<Page_Down>", spawn "mpc next")
, ("C-M-<Home>" , spawn "mpc toggle")
, ("M-s" , spawn "konsole")
, ("M-f" , spawn "firefox")
, ("M-v" , spawn "VBoxManage startvm xa4a-win")
, ("M-d" , spawn "toggle_displays")
, ("C-M-<Right>", withFocused (keysMoveWindow (20, 0)))
, ("C-M-<Left>", withFocused (keysMoveWindow (-20, 0)))
, ("C-M-<Up>", spawn "mpc volume +5")
, ("C-M-<Down>", spawn "mpc volume -5")
-- , ("C-M-<Up>", withFocused (keysMoveWindow (0, -20)))
-- , ("C-M-<Down>", withFocused (keysMoveWindow (0, 20)))
, ("M-S-<Right>", withFocused (keysResizeWindow (20, 0) (0, 0)))
, ("M-S-<Left>", withFocused (keysResizeWindow (-20, 0) (0, 0)))
, ("M-S-<Up>", withFocused (keysResizeWindow (0, -20) (0, 0)))
, ("M-S-<Down>", withFocused (keysResizeWindow (0, 20) (0, 0)))
, ("M-a", shellPrompt myXPConfig)
, ("M-z", xmonadPrompt myXPConfig)
]
--imLayout = avoidStruts $
-- reflectHoriz (IM (1%7) (Or (And (ClassName "Kopete") (Role "mainWindow") ) (And (ClassName "Kopete") (Role "MainWindow#1") )))--(Role "mainWindow")))
--myWithIM l = reflectHoriz (withIM (1%7) l)
myWithIM l = reflectHoriz (withIM (1%7) (Or (Or (And (ClassName "Kopete") (Role "mainWindow") ) (And (ClassName "Kopete") (Role "MainWindow#1") )) (And (ClassName "Qutim") (Title "qutIM") )) l)
myIM = avoidStruts
$ myWithIM tiled ||| myWithIM (Mirror tiled) ||| myWithIM (noBorders owntab)
where
tiled = Mirror $ reflectVert $ reflectHoriz $ Tall 1 (3/100) (1/2)
owntab = tabbed shrinkText tabbedConf
genericLayouts = smartBorders
$ avoidStruts
$ toggleLayouts (noBorders Full)
$ tiled ||| Mirror tiled ||| (noBorders owntab)
where
tiled = Tall 1 (3/100) (1/2)
owntab = tabbed shrinkText tabbedConf
--ownLayoutHook = onWorkspaces ["im"] (imLayout) $
ownLayoutHook = onWorkspaces ["im"] (myIM) $
genericLayouts
myManageHook = composeAll
[ className =? "MPlayer" --> doFloat
, className =? "<unknown>" --> doFloat
, className =? "Gimp" --> doFloat
, className =? "Pgadmin3" --> doFloat
, className =? "XVroot" --> doFloat
, className =? "openttd" --> doFloat
, className =? "Download" --> doFloat
, className =? "Main.py" --> doFloat
, resource =? "desktop_window" --> doIgnore
, resource =? "kdesktop" --> doIgnore
, className =? "Firefox" --> moveTo "firefox"
, className =? "Thunderbird" --> moveTo "thunderbird"
, className =? "Kopete" --> moveTo "im"
, className =? "Gajim.py" --> moveTo "im"
]
where moveTo = doF . W.shift
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
ownPP h = defaultPP
{ ppOutput = hPutStrLn h
, ppCurrent = xmobarColor "white" "" . wrap "[" "]"
, ppVisible = xmobarColor "yellow" "" . wrap "*" "*"
, ppUrgent = xmobarColor "red" "" . wrap "|" "|"
, ppTitle = xmobarColor "#00ee00" ""
, ppSep = " "
, ppLayout = (\x -> "")
}
ownConfig statusbar = defaultConfig
{ workspaces = myWorkspaces
, terminal = myTerminal
, logHook = dynamicLogWithPP $ ownPP statusbar
--, layoutHook = ewmhDesktopsLayout $ ownLayoutHook
, layoutHook = ownLayoutHook
, manageHook = myManageHook
, startupHook = setWMName "LG3D"
}
main = do statusbar <- spawnPipe statusBarCmd
xmonad $ ownConfig statusbar `additionalKeysP` addKeys