[ create a new paste ] login | about

Link: http://codepad.org/BsizN8cJ    [ raw code | fork ]

Plain Text, pasted on Jan 31:
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
import System.IO
import System.Exit
import Data.Maybe(isJust)
import Data.Monoid
import qualified Data.Map as M
import Text.Regex.Posix ((=~)) -- needed for regex matching of libreoffice windows classes

import XMonad

import XMonad.Hooks.DynamicLog 
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.UrgencyHook

import XMonad.Layout.FixedColumn
import XMonad.Layout.Grid
import XMonad.Layout.NoBorders
import XMonad.Layout.PerWorkspace
import XMonad.Layout.ThreeColumns
import XMonad.Layout.Tabbed
import XMonad.Layout.ToggleLayouts
import XMonad.Layout.Master
import XMonad.Layout.Named
import XMonad.Layout.ResizableTile

import XMonad.Actions.CopyWindow
import XMonad.Actions.CycleWS
import XMonad.Actions.RotSlaves
import XMonad.Actions.WithAll -- for killing all applications on a workspace
import XMonad.Actions.FloatSnap 
import XMonad.Actions.FloatKeys
import qualified XMonad.Actions.FlexibleResize as Flex  -- for resizing floating windows from any corner

import XMonad.Util.Run -- for spawnPipe and hPutStrLn
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.Loggers
import XMonad.Util.Scratchpad
import XMonad.Util.NamedScratchpad

import XMonad.Prompt
import XMonad.Prompt.AppLauncher as AL

import XMonad.StackSet(stack)
import qualified XMonad.StackSet as W

q ~? x = fmap (=~ x) q -- for regex matching libreoffice

altMask = mod1Mask

dmenuRun =  "exe=`dmenu_run -i -nb black -nf white -sb '#ddaa11' -sf black -p 'run: ' -fn '-*-dejavu sans-medium-r-normal--14-*-*-*-*-*-iso8859-1'` && eval \"exec $exe\""

scratchPad  = scratchpadSpawnActionTerminal myScratchpadTerminal
 
myScratchpadTerminal :: String
myScratchpadTerminal = "urxvtc -name scratchpad -title 'scratchpad' -sh 20 -fade 50 -fn 'xft:Liberation Mono:style=Regular:pixelsize=11' -fb 'xft:Liberation Mono:style=Bold:pixelsize=11'"

namedScratchpads = 
    [  NS "pwman" "urxvtc -title pwman -si -sh 30 -fn \"xft:Liberation Mono:style=Regular:pixelsize=12\" -fb \"xft:Liberation Mono:style=Bold:pixelsize=11\" -fade 30 -name pwman -e bash -c \"xdotool key super+a; pwman\"" (title =? "pwman") (customFloating $ W.RationalRect 0.5 0.5 0.45 0.45)
     , NS "pavucontrol" "pavucontrol" (appName =? "pavucontrol") (customFloating $ W.RationalRect 0.5 0.5 0.4 0.45)
     , NS "googlecalendar" "chromium --app=http://www.google.com/calendar/render" (title =? "Google Calendar") nonFloating
     , NS "facebook" "chromium --app=https://www.facebook.com/?ref=home" (title =? "Facebook") nonFloating
    ]

myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $

    [ ((modm                  , xK_t        ), spawn $ XMonad.terminal conf) 
    , ((modm .|. shiftMask    , xK_t        ), spawn "urxvtc -pe tabbed" )
    , ((modm .|. controlMask  , xK_t        ), spawn "urxvtc -pe tabbed" )

    , ((modm                  , xK_r        ), spawn dmenuRun )    
    , ((0                     , xK_Print    ), spawn dmenuRun ) 
    , ((0                     , 0xff67      ), spawn dmenuRun )  -- XF86MenuKB doesn't work

    , ((modm                  , xK_m        ), spawn "/home/owain/bin/mounter")           
    , ((modm                  , xK_slash    ), spawn "/home/owain/bin/mpdosd")        
    , ((modm                  , xK_c        ), namedScratchpadAction namedScratchpads "googlecalendar" )
    , ((modm                  , xK_f        ), namedScratchpadAction namedScratchpads "facebook" )
    , ((modm                  , xK_g        ), spawn "uzbl-browser \"http://www.google.co.uk/search?q=$(xclip -o -selecton primary | dmenu -p 'Google:' -i -nb black -nf white -sb '#ddaa11' -sf black -fn '-*-dejavu sans-medium-r-normal--14-*-*-*-*-*-iso859-1' )\" ")
    , ((modm                  , xK_w        ), spawn "uzbl-browser \"http://www.google.co.uk/search?q=$(xclip -o -selecton primary | dmenu -p 'Wikipedia:' -i -nb black -nf white -sb '#ddaa11' -sf black -fn '-*-dejavu sans-medium-r-normal--14-*-*-*-*-*-iso859-1' )%20wiki\" ")
    , ((modm                  , xK_y        ), spawn "uzbl-browser \"http://www.youtube.com/results?search_query=(xclip -o -selecton primary | dmenu -p 'Youtube:' -i -nb black -nf white -sb '#ddaa11' -sf black -fn '-*-dejavu sans-medium-r-normal--14-*-*-*-*-*-iso859-1' )\" ")
    , ((modm                  , xK_n        ), refresh)                -- Resize viewed windows to the correct size
    , ((modm .|. controlMask  , xK_r        ), spawn "gmrun") 
    , ((modm                  , xK_s        ), spawn "/home/owain/bin/search")
    , ((modm                  , xK_v        ), namedScratchpadAction namedScratchpads "pavucontrol" )
    -- , ((modm                  , xK_z        ), spawn "zathura")
    , ((modm                  , xK_z        ), spawn "evince")

    , ((0                     , 0x1008ff19  ), spawn "/home/owain/bin/mail" ) -- 'mail' hotkey
    , ((0                     , 0x1008ff18  ), spawn "uzbl-browser" )
    , ((modm                  , xK_e        ), spawn "uzbl-browser" ) -- stupid Lenovo implement 'Explorer' hotkey as win+e
    , ((controlMask           , 0x1008ff18  ), spawn "chromium" )
    , ((modm                  , xK_p        ), namedScratchpadAction namedScratchpads "pwman" ) 

    , ((altMask               , xK_F4       ), kill)          
    , ((modm                  , xK_x        ), kill)          
    , ((0                     , 0x1008ff56  ), kill)          
    , ((modm .|. controlMask  , xK_F4       ), killAll ) 

    , ((0                     , xK_F12      ), scratchPad )

    , ((modm                  , xK_space    ), sendMessage NextLayout) 
    , ((modm .|. controlMask  , xK_space    ), setLayout $ XMonad.layoutHook conf)

    , ((altMask               , xK_Tab      ), rotAllUp )  
    -- , ((altMask               , xK_space    ), rotAllUp )
    , ((altMask .|. shiftMask , xK_Tab      ), rotAllDown )
    -- , ((altMask .|. shiftMask , xK_space    ), rotAllDown )
    , ((modm                  , xK_Down     ), windows W.focusDown)   
    , ((modm                  , xK_j        ), windows W.focusDown)
    , ((modm .|. shiftMask    , xK_Tab      ), windows W.focusUp)    
    , ((modm                  , xK_Up       ), windows W.focusUp)       
    , ((modm .|. shiftMask    , xK_Tab      ), windows W.focusUp)       
    , ((modm                  , xK_k        ), windows W.focusUp)
    -- , ((modm                  , xK_Home     ), windows W.focusMaster  )  -- Move focus to the master window
    , ((altMask               , xK_space    ), windows W.focusMaster  )  
    , ((modm                  , xK_Escape   ), windows W.swapMaster)     -- Swap the focused window and the master window
    -- , ((modm                  , xK_KP_Enter ), windows W.swapMaster)     -- Swap the focused window and the master window
    , ((modm                  , xK_equal    ), sendMessage Expand)       -- Expand the master area
    , ((modm .|. controlMask  , xK_equal    ), sendMessage MirrorShrink)       -- Expand the tiled area
    , ((modm                  , xK_minus    ), sendMessage Shrink)       -- Shrink the master area
    , ((modm .|. controlMask  , xK_minus    ), sendMessage MirrorExpand)       -- Shrink the tiled area
    , ((modm .|. shiftMask    , xK_j        ), windows W.swapDown  )     -- Swap the focused window with the next window
    , ((modm .|. shiftMask    , xK_k        ), windows W.swapUp    )     -- Swap the focused window with the previous window

    , ((modm                  , xK_comma    ), sendMessage (IncMasterN 1))    -- Increment the number of windows in the master area
    , ((modm                  , xK_period   ), sendMessage (IncMasterN (-1)))    -- Deincrement the number of windows in the master area
    , ((modm                  , xK_Return   ), focusUrgent)
    , ((modm                  , xK_KP_Enter ), focusUrgent)
    , ((modm .|. shiftMask    , xK_Return   ), clearUrgents)
    , ((modm .|. shiftMask    , xK_KP_Enter ), clearUrgents)
    , ((modm                  , xK_Tab      ), sendMessage ToggleLayout )

    -- , ((modm                  , xK_Return       ), toggleWS)
    -- , ((modm                  , xK_KP_Enter     ), toggleWS)
    , ((modm                  , xK_BackSpace    ), toggleWS)
    , ((modm                  , xK_Right        ), moveTo Next (WSIs (return $ not . (=="NSP") . W.tag)) )
    , ((modm                  , xK_bracketright ), moveTo Next (WSIs (return $ not . (=="NSP") . W.tag)) )
    , ((modm                  , xK_l            ), moveTo Next (WSIs (return $ not . (=="NSP") . W.tag)) )

    , ((modm                  , xK_Left         ), moveTo Prev (WSIs (return $ not . (=="NSP") . W.tag)) )
    , ((modm                  , xK_bracketleft  ), moveTo Prev (WSIs (return $ not . (=="NSP") . W.tag)) )
    , ((modm                  , xK_h            ), moveTo Prev (WSIs (return $ not . (=="NSP") . W.tag)) )

    , ((modm .|. controlMask  , xK_Right        ), shiftTo Next (WSIs (return $ not . (=="NSP") . W.tag)) ) 
    , ((modm .|. controlMask  , xK_bracketright ), shiftTo Next (WSIs (return $ not . (=="NSP") . W.tag)) )
    , ((modm .|. controlMask  , xK_l            ), shiftTo Next (WSIs (return $ not . (=="NSP") . W.tag)) )

    , ((modm .|. controlMask  , xK_Left         ), shiftTo Prev (WSIs (return $ not . (=="NSP") . W.tag)) )
    , ((modm .|. controlMask  , xK_bracketleft  ), shiftTo Prev (WSIs (return $ not . (=="NSP") . W.tag)) )
    , ((modm .|. controlMask  , xK_h            ), shiftTo Prev (WSIs (return $ not . (=="NSP") . W.tag)) )

    , ((modm .|. altMask      , xK_h            ), withFocused $ snapMove L Nothing)  -- floatSnap
    , ((modm .|. altMask      , xK_l            ), withFocused $ snapMove R Nothing)
    , ((modm .|. altMask      , xK_k            ), withFocused $ snapMove U Nothing)
    , ((modm .|. altMask      , xK_j            ), withFocused $ snapMove D Nothing)
    , ((modm .|. altMask .|. controlMask , xK_h ), withFocused $ snapShrink R Nothing)  -- floatSnap resize
    , ((modm .|. altMask .|. controlMask , xK_l ), withFocused $ snapGrow   R Nothing)
    , ((modm .|. altMask .|. controlMask , xK_k ), withFocused $ snapShrink U Nothing)
    , ((modm .|. altMask .|. controlMask , xK_j ), withFocused $ snapGrow   D Nothing)

    , ((modm .|. altMask      , xK_Up           ), withFocused ( keysMoveWindow (   0,-100)) ) 
    , ((modm .|. altMask      , xK_Down         ), withFocused ( keysMoveWindow (   0, 100)) )
    , ((modm .|. altMask      , xK_Left         ), withFocused ( keysMoveWindow (-100,   0)) )
    , ((modm .|. altMask      , xK_Right        ), withFocused ( keysMoveWindow ( 100,   0)) )
    , ((modm .|. altMask      , xK_space        ), withFocused ( keysMoveWindowTo (720,450) (0.5, 0.5)) ) -- center the window on screen
    , ((modm .|. altMask .|. controlMask , xK_Up    ), withFocused ( keysResizeWindow (0  ,-50) (0, 0)) )
    , ((modm .|. altMask .|. controlMask , xK_Down  ), withFocused ( keysResizeWindow (0  , 50) (0, 0)) )
    , ((modm .|. altMask .|. controlMask , xK_Left  ), withFocused ( keysResizeWindow (-50,  0) (0, 0)) )
    , ((modm .|. altMask .|. controlMask , xK_Right ), withFocused ( keysResizeWindow ( 50,  0) (0, 0)) )


    , ((modm                  , xK_a        ), sequence_ $ [windows $ copy i | i <- XMonad.workspaces conf])    -- Pin to all workspaces
    , ((modm .|. controlMask  , xK_a        ), windows $ kill8 )    -- remove from all but current
    , ((modm                  , xK_u        ), spawn "if [[ $(pgrep fullupdate) == '' ]]; then /home/owain/bin/fullupdate; fi") 
    , ((modm .|. controlMask  , xK_u        ), spawn "if [[ $(pgrep fullupdate) == '' ]]; then /home/owain/bin/fullupdateaur; fi") 
   
    , (( 0                    , 0x1008ff13    ), spawn "volume-up")
    , (( 0                    , 0x1008ff11    ), spawn "volume-down")     
    , (( 0                    , 0x1008ff12    ), spawn "volume-mute")
    , (( 0                    , 0x1008ff17    ), spawn "mpc next; mpdosd")
    , ((modm                  , xK_apostrophe ), spawn "mpc next; mpdosd")
    , (( 0                    , 0x1008ff16    ), spawn "mpc prev; mpdosd")
    , ((modm                  , xK_semicolon  ), spawn "mpc prev; mpdosd")
    , (( 0                    , 0x1008ff15    ), spawn "mpc stop")
    , (( 0                    , 0x1008ff14    ), spawn "if [[ $(mpc toggle | grep -c playing ) != '0' ]]; then mpdosd; fi")
    , ((modm                  , xK_numbersign ), spawn "if [[ $(mpc toggle | grep -c playing ) != '0' ]]; then mpdosd; fi")

    , (( controlMask          , 0x1008ff17    ), spawn "echo seek 10 > ~/.mplayer_fifo")
    , (( controlMask          , 0x1008ff16    ), spawn "echo seek -10 > ~/.mplayer_fifo")
    , (( controlMask          , 0x1008ff15    ), spawn "echo stop > ~/.mplayer_fifo")
    , (( controlMask          , 0x1008ff14    ), spawn "echo pause > ~/.mplayer_fifo")

    , ((modm .|. shiftMask    , xK_q        ), io (exitWith ExitSuccess))    -- Quit xmonad
    , ((modm                  , xK_q        ), spawn "xmonad --recompile; xmonad --restart")    -- Restart xmonad

    ]
    ++

    [((m .|. modm, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [ xK_KP_End, xK_KP_Down
            , xK_KP_Page_Down, xK_KP_Left, xK_KP_Begin, xK_KP_Right 
            , xK_KP_Home, xK_KP_Up, xK_KP_Page_Up, xK_F1, xK_F2
            , xK_F3, xK_F4, xK_F5, xK_F6, xK_F7, xK_F8, xK_F9 ] 
       , (f, m) <- [(W.greedyView, 0), (W.shift, controlMask)]]

    ++

    [((m .|. modm .|. shiftMask, k), windows $ f i)   -- Ugly hack, using SysReq on the expectation that I'll never press it, and shift-mod-numpad for mod-Fx emulation
        | (i, k) <- zip (XMonad.workspaces conf) [ xK_Sys_Req, xK_Sys_Req, xK_Sys_Req
            , xK_Sys_Req, xK_Sys_Req, xK_Sys_Req
            , xK_Sys_Req, xK_Sys_Req, xK_Sys_Req
            , xK_KP_End, xK_KP_Down , xK_KP_Page_Down
            , xK_KP_Left, xK_KP_Begin, xK_KP_Right 
            , xK_KP_Home, xK_KP_Up, xK_KP_Page_Up ] 
       , (f, m) <- [(W.greedyView, 0), (W.shift, controlMask)]]

    ++

    [((m .|. modm, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
        , (f, m) <- [(W.greedyView, 0), (W.shift, controlMask)]]


--- funtion for ctrl-mod-A to remove from 'all workspaces' above
kill8 ss | Just w <- W.peek ss = (W.insertUp w) $ W.delete w ss | otherwise = ss


myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
    [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
                                       >> windows W.shiftMaster))  -- left click: float/move window
    , ((modm, button2), (\w -> focus w >> (withFocused $ windows . W.sink))) -- middle click: unfloat
    , ((modm, button3), (\w -> focus w >> Flex.mouseResizeWindow w)) -- right click: resize  
    ]


myTabConfig = defaultTheme  { activeTextColor       = "#DDAA11"
                            , activeColor           = "#000000"
                            , activeBorderColor     = "#DDAA11"
                            , inactiveColor         = "#000000" 
                            , inactiveBorderColor   = "#505050"
                            , inactiveTextColor     = "#909090"
                            , urgentTextColor       = "#21C1B9"
                            , urgentColor           = "#000000"
                            , urgentBorderColor     = "#21C1B9"
                            , fontName              = "xft:DejaVu LGC Sans Mono:style=Regular:pixelsize=10" }


myManageHook = ( composeAll
    [ isFullscreen                      --> doFullFloat
    , className =? "Mirage"             --> doFullFloat
    , className =? "Googleearth-bin"    --> doFullFloat
    ,   appName =? "fullfloat"          --> doFullFloat

    , className =? "Conky"              --> doIgnore  
    ,   appName =? "desktop_window"     --> doIgnore
    ,   appName =? "kdesktop"           --> doIgnore
    ,   appName =? "xfce4-notifyd"      --> doIgnore

    , className =? "Skype"              --> doSideFloat CE
    ,   appName =? "pavucontrol"        --> doFloatAt 0.5 0.5
    , className =? "MPlayer"            --> doCenterFloat
    , className =? "Vlc"                --> doCenterFloat
    , className =? "Gxine"              --> doCenterFloat
    , className =? "qjackctl"           --> doCenterFloat
    ,   appName =? "Qjackctl"           --> doCenterFloat
    , className =? "qjackctl"           --> doCenterFloat
    ,   appName =? "Qjackctl"           --> doCenterFloat
    , className =? "Virtual Keyboard"   --> doCenterFloat
    ,   appName =? "Virtual Keyboard"   --> doCenterFloat
    , className =? "vkeybd.tcl"         --> doCenterFloat
    ,   appName =? "vkeybd.tcl"         --> doCenterFloat
    ,   appName =? "centerfloat"        --> doCenterFloat
    ,   appName =? "display"            --> doCenterFloat
    ,   appName =? "zenity"             --> doCenterFloat
    , className =? "SpiderOak"          --> doCenterFloat
    , className =? "yndiag"             --> doCenterFloat -- GFTP
    , className =? "dirlist"            --> doCenterFloat -- ditto
    ,   appName =? "yndiag"             --> doCenterFloat
    ,   appName =? "dirlist"            --> doCenterFloat
    ,   appName =? "gtklp"              --> doCenterFloat 

    , className =? "Update"             --> doFloatAt 0.55 0.55
    , className =? "Full update"        --> doFloatAt 0.55 0.55
    ,   appName =? "update"             --> doFloatAt 0.55 0.55
    , className =? "pwman"              --> doFloatAt 0.55 0.55
    ,   appName =? "pwman"              --> doFloatAt 0.55 0.55
    ,   appName =? "download"           --> doFloatAt 0.55 0.55
    , className =? "Gcalctool"          --> doFloatAt 0.6 0.6
    , className =? "Radio"              --> doFloatAt 0.8 0.05
    ,     title =? "Radio"              --> doFloatAt 0.2 0.2  
    , className =? "Zenity"             --> doFloat

    , className =? "Wine"               --> doF (W.shift workspace7 )
    ,   appName =? "web"                --> doF (W.shift workspace1 )
    ,   appName =? "uzbl-core"          --> doF (W.shift workspace1 )
    ,   appName =? "web"                --> doF (W.shift workspace1 )   
    ,   appName =? "rss"                --> doF (W.shift workspace3 )
    , className =? "Newsbeuter"         --> doF (W.shift workspace3 ) 
    ,   appName =? "mail"               --> doF (W.shift workspace4 )
    ,   appName =? "mutt"               --> doF (W.shift workspace4 )
    , className =? "Mutt"               --> doF (W.shift workspace4 ) 
    ,   appName =? "irc"                --> doF (W.shift workspace2 )
    , className =? "irssi"              --> doF (W.shift workspace2 )
    ,   appName =? "irssi"              --> doF (W.shift workspace2 )
    ,   appName =? "music"              --> doF (W.shift workspace5 )
    , className =? "mpd"                --> doF (W.shift workspace5 )
    ,   appName =? "spotify.exe"        --> doF (W.shift workspace5 )
    , className ~? "^libreoffice"       --> doF (W.shift workspace6 )
    , className ~? "libreoffice-writer" --> doF (W.shift workspace6 )
    , className =? "Gnucash"            --> doF (W.shift workspace6 ) 
    , className =? "VirtualBox"         --> doF (W.shift workspace8 )
    , className =? "VBoxSDL"            --> doF (W.shift workspace8 )

    , manageDocks
    ] ) <+> (composeOne
    [ isFullscreen                      -?> doFullFloat   
    , className =? "MPlayer"            -?> doCopyToAll
    , className =? "Vlc"                -?> doCopyToAll
    ,   appName =? "pavucontrol"        -?> doCopyToAll
    ] ) 

manageScratchPad :: ManageHook
manageScratchPad = scratchpadManageHook (W.RationalRect l t w h)

  where
      h = 0.2     -- terminal height, 10%
      w = 0.96    -- terminal width, 100%
      t = 0.02    -- distance from top edge, 90%
      l = 0.02    -- distance from left edge, 0%

doCopyToAll = ask >>= doF . \w -> (\ws -> foldr($) ws (map (copyWindow w) myWorkspaces))


myNormalColor     = "#BABDB6"
myFocusedColor    = "#DDAA11"
black             = "#000000"

myPP handle = defaultPP {
          ppCurrent         = dzenColor myFocusedColor black
        , ppVisible         = dzenColor myNormalColor  black
        , ppUrgent          = dzenColor black "#21C1B9"
        , ppTitle           = dzenColor myFocusedColor black

        , ppHiddenNoWindows = noScratchPad -- without this, not all 9 other names are shown.  Go figure.
        , ppLayout          = dzenColor myFocusedColor black . wrap "^ca(1,xdotool key Super_L+space)[" "]^ca()" 
        , ppOutput          = hPutStrLn handle
        , ppSort = fmap (.scratchpadFilterOutWorkspace) $ ppSort defaultPP
 }
    where
        noScratchPad ws
            | ws == "NSP"   = ""
            | otherwise     = ws


myXPConfig = defaultXPConfig {
      bgColor           = "black"
    , fgColor           = "#DDAA11"
    , fgHLight          = "black"
    , bgHLight          = "#DDAA11"
    , font              = "-*-dejavu sans-medium-r-normal--14-*-*-*-*-*-iso8859-1"
    , borderColor       = "#DDAA11"
    , promptBorderWidth = 2
    , position          = Top
    , height            = 24
}


myWorkspaces  = [ "^ca(1,xdotool key super+1)web^ca()"
                , "^ca(1,xdotool key super+2)irc^ca()"
                , "^ca(1,xdotool key super+3)rss^ca()"
                , "^ca(1,xdotool key super+4)mail^ca()"
                , "^ca(1,xdotool key super+5)music^ca()"
                , "^ca(1,xdotool key super+6)office^ca()"
                , "^ca(1,xdotool key super+7)wine^ca()"
                , "^ca(1,xdotool key super+8)vbox^ca()"
                , "^ca(1,xdotool key super+9)misc^ca()"
                , "^ca(1,xdotool key super+F1)f1^ca()"
                , "^ca(1,xdotool key super+F2)f2^ca()"
                , "^ca(1,xdotool key super+F3)f3^ca()"
                , "^ca(1,xdotool key super+F4)f4^ca()"
                , "^ca(1,xdotool key super+F5)f5^ca()"
                , "^ca(1,xdotool key super+F6)f6^ca()"
                , "^ca(1,xdotool key super+F7)f7^ca()"
                , "^ca(1,xdotool key super+F8)f8^ca()"
                , "^ca(1,xdotool key super+F9)f9^ca()"
                ]

workspace1 = "^ca(1,xdotool key super+1)web^ca()"
workspace2 = "^ca(1,xdotool key super+2)irc^ca()"
workspace3 = "^ca(1,xdotool key super+3)rss^ca()"
workspace4 = "^ca(1,xdotool key super+4)mail^ca()"
workspace5 = "^ca(1,xdotool key super+5)music^ca()"
workspace6 = "^ca(1,xdotool key super+6)office^ca()"
workspace7 = "^ca(1,xdotool key super+7)wine^ca()"
workspace8 = "^ca(1,xdotool key super+8)vbox^ca()"
workspace9 = "^ca(1,xdotool key super+9)misc^ca()"
     
workspaceF1 = "^ca(1,xdotool key super+F1)f1^ca()"
workspaceF2 = "^ca(1,xdotool key super+F2)f2^ca()"
workspaceF3 = "^ca(1,xdotool key super+F3)f3^ca()"
workspaceF4 = "^ca(1,xdotool key super+F4)f4^ca()"
workspaceF5 = "^ca(1,xdotool key super+F5)f5^ca()"
workspaceF6 = "^ca(1,xdotool key super+F6)f6^ca()"
workspaceF7 = "^ca(1,xdotool key super+F7)f7^ca()"
workspaceF8 = "^ca(1,xdotool key super+F8)f8^ca()"
workspaceF9 = "^ca(1,xdotool key super+F9)f9^ca()"

myUrgencyHook = dzenUrgencyHook { 
      duration = seconds 3
    , args = 
    [ "-bg", "#DDAA11"
    , "-fg", "#000000"
    , "-fn", "-liberation-mono-medium-r-normal-8-*-72-*-*-*-*-iso8859-*"
    , "-ta", "c"
    , "-sa", "c"
    ] }

myStartupHook = do 
    spawn "/home/owain/bin/xmonad-startup"
    spawn "numlockx on"

main = do 
    h <- spawnPipe "dzen2 -e - -h 14 -ta l -w 800 -fg '#E0E0E0' -bg '#000000' -fn '-liberation-mono-medium-r-normal-4-*-72-*-*-*-*-iso8859-*' "

    xmonad $ withUrgencyHookC myUrgencyHook urgencyConfig { suppressWhen = Visible } $ ewmh defaultConfig -- default is 'suppressWhen = Visible'
        { terminal              = "urxvtc"
        , modMask               = mod4Mask
        , borderWidth           = 1
        , normalBorderColor     = "#000000" 
        , focusedBorderColor    = "#DDAA11"
        , workspaces            = myWorkspaces
        , keys                  = myKeys        
        , mouseBindings         = myMouseBindings
        , layoutHook            = toggleLayouts ( Grid ) 
                                    $ avoidStruts  

                                    $ onWorkspace workspace1 (    named "Tabbed" myTabbed ||| 
                                                                  named "Tiled" ( smartBorders myTiled ) ||| 
                                                                  named "Horiz Tiled" ( smartBorders ( Mirror myTiled ))  ) 

                                    $ onWorkspace workspace6 (    named "Horiz Tiled" ( smartBorders ( Mirror myTiled )) |||
                                                                  named "Tabbed" myTabbed ||| 
                                                                  named "Tiled" ( smartBorders myTiled ) ) 

                                    $ onWorkspace workspace8 (    named "Full" ( noBorders Full ) |||
                                                                  named "Tiled" ( smartBorders myTiled ) |||
                                                                  named "Horiz Tiled" ( smartBorders ( Mirror myTiled )) ||| 
                                                                  named "Fixed Col" ( smartBorders ( FixedColumn 1 20 80 10 )) ||| 
                                                                  named "Tabbed" myTabbed )

                                    $ onWorkspace workspaceF9 (   named "Tabbed" myTabbed ||| 
                                                                  named "Tiled" ( smartBorders myTiled ) ||| 
                                                                  named "Horiz Tiled" ( smartBorders ( Mirror myTiled ))  ) 

                                    $ named "Tiled" ( smartBorders myTiled ) ||| 
                                      named "Horiz Tiled" ( smartBorders ( Mirror myTiled )) ||| 
                                      named "Fixed Col" ( smartBorders ( FixedColumn 1 20 80 10 )) ||| 
                                      named "Tabbed" myTabbed ||| 
                                      named "Full" ( noBorders Full )

        , manageHook            = manageDocks <+> manageScratchPad <+> namedScratchpadManageHook namedScratchpads <+> myManageHook
        , startupHook           = myStartupHook
        , logHook               = dynamicLogWithPP $ myPP h
        }
    where
        myTiled = ResizableTall 1 (3/100) (1/2) []
        myTabbed = smartBorders ( tabbedAlways shrinkText myTabConfig )

-- vim:foldmethod=marker sw=4 sts=4 ts=4 tw=0 et ai nowrap



Create a new paste based on this one


Comments: