All pastes #2022117 Raw Edit

clueless

public text v1 · immutable
#2022117 ·published 2010-12-17 14:49 UTC
rendered paste body
import XMonadimport System.Exitimport System.IOimport qualified XMonad.StackSet as Wimport qualified Data.Map        as Mimport Data.List -- for isSuffixOfimport XMonad.Actions.CycleWSimport qualified XMonad.Actions.FlexibleManipulate as Fleximport XMonad.Actions.NoBordersimport XMonad.Actions.GridSelectimport XMonad.Actions.WindowBringerimport XMonad.Actions.UpdatePointerimport XMonad.Hooks.ManageHelpersimport XMonad.Hooks.DynamicLogimport XMonad.Hooks.ManageDocksimport XMonad.Hooks.FadeInactiveimport XMonad.Hooks.EwmhDesktops-- import XMonad.Util.Run(spawnPipe)import XMonad.Util.WindowPropertiesimport XMonad.Util.NamedScratchpadimport XMonad.Util.WorkspaceCompareimport XMonad.Layout.Tabbedimport XMonad.Layout.DecorationMadnessimport XMonad.Layout.NoBordersimport XMonad.Layout.TwoPaneimport XMonad.Layout.ComboPimport XMonad.Layout.ShowWNameimport XMonad.Layout.Magnifierimport XMonad.Promptimport XMonad.Prompt.Shellimport Graphics.X11.ExtraTypes.XF86amphiFont              	= "xft:Bitstream Vera Sans-10:Normal"amphiNormalFGColor     	= "#9c9c9c"amphiFocusedFGColor    	= "#C4B089"amphiUrgentFGColor     	= "#f57900"amphiUrgentBGColor     	= amphiNormalBGColoramphiSeperatorColor    	= "#2e3436"-- clearlooks shadow theme--amphiNormalBGColor     	= "#2c2c2c"--amphiFocusedBGColor    	= "#3f3f3f"--amphiFocusedBorderColor	= "#8686B3"--amphiNormalBorderColor 	= "#2c2c2c"-- gommapiumalooks themeamphiNormalBGColor     	= "#4c4e4a"amphiFocusedBGColor    	= "#585a55"amphiFocusedBorderColor	= "#7a7e78"amphiNormalBorderColor 	= "#3f413d"amphiXPConfig = defaultXPConfig     { bgColor = amphiNormalBGColor    , fgColor = amphiNormalFGColor    , fgHLight = amphiFocusedFGColor    , bgHLight = amphiNormalBGColor    , height = 16    , position = Top    , font = amphiFont    , borderColor = amphiNormalBorderColor    , historyFilter = \x -> []    , autoComplete  = Just 500000 -- Just x[in microseconds]: if only one completion remains, auto-select it --    }amphiGSConfig = defaultGSConfig     { gs_font = "xft:Bitstream Vera Sans-10:Normal"    , gs_cellwidth = 160    , gs_cellheight = 45    }scratchpadSize = W.RationalRect 0.05 0.05 0.9 0.9amphiSPFloat = customFloating scratchpadSizescratchpads =     [ NS "scratchpad" "xfce4-terminal --title scratchpad" (title =? "scratchpad") amphiSPFloat    , NS "editpad" "gvim --role editpad" (role =? "editpad") amphiSPFloat    , NS "calcpad" "xcalc" (className =? "XCalc") (customFloating $ W.RationalRect (3/8) (1/4.5) (1/4) (1/2.2))    ] where role = stringProperty "WM_WINDOW_ROLE"amphiKeys conf@(XConfig {modMask = modm}) = M.fromList $	-- switch to non-empty ws	[ ((0, xF86XK_Forward), windows . W.greedyView =<< findWorkspace getSortByIndexNoNSP Next HiddenNonEmptyWS 1)	, ((0, xF86XK_Back), windows . W.greedyView =<< findWorkspace getSortByIndexNoNSP Prev HiddenNonEmptyWS 1)	-- switch to empty ws	, ((controlMask, xF86XK_Forward), windows . W.greedyView =<< findWorkspace getSortByIndexNoNSP Next EmptyWS 1)	, ((controlMask, xF86XK_Back), windows . W.greedyView =<< findWorkspace getSortByIndexNoNSP Prev EmptyWS 1)	-- send window to any ws except NSP	, ((shiftMask, xF86XK_Forward), shiftTo Next (WSIs notNSP))	, ((shiftMask, xF86XK_Back), shiftTo Prev (WSIs notNSP)) 	-- send window to empty ws	, ((controlMask .|. shiftMask, xF86XK_Forward), windows . W.shift =<< findWorkspace getSortByIndexNoNSP Next EmptyWS 1)	, ((controlMask .|. shiftMask, xF86XK_Back), windows . W.shift =<< findWorkspace getSortByIndexNoNSP Prev EmptyWS 1)	-- send windpow to empty ws & focus it	, ((modm .|. shiftMask, xF86XK_Forward), shiftAndView' Next)	, ((modm .|. shiftMask, xF86XK_Back), shiftAndView' Prev)	--	, ((modm, xK_grave), namedScratchpadAction scratchpads "scratchpad")	, ((modm, xK_v), namedScratchpadAction scratchpads "editpad")	, ((modm, xK_c), namedScratchpadAction scratchpads "calcpad")	, ((modm, xK_w), toggleWS)	, ((modm, xK_b), sendMessage ToggleStruts)	, ((modm, xK_d), withFocused toggleBorder)		, ((modm .|. controlMask, xK_m), sendMessage Toggle)	, ((modm, xK_g), goToSelected amphiGSConfig)	, ((modm , xK_x), shellPrompt amphiXPConfig { position = Top, borderColor = amphiFocusedBorderColor })    ] where notNSP = (return $ ("NSP" /=) . W.tag) :: X (WindowSpace -> Bool)	    getSortByIndexNoNSP = fmap (.namedScratchpadFilterOutWorkspace) getSortByIndex		    shiftAndView' dir = findWorkspace getSortByIndexNoNSP dir EmptyWS 1 >>= \t -> (windows . W.shift $ t) >> (windows . W.greedyView $ t)amphiMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $	[ ((modm, button1), (\w -> focus w >> mouseMoveWindow w))	, ((modm, button2), (\w -> focus w >> windows W.shiftMaster)) -- raise window to top of stack	, ((modm, button3), (\w -> focus w >> Flex.mouseWindow Flex.linear w))]	tabbedConf = defaultTheme 	{ inactiveBorderColor	= amphiNormalBorderColor	, activeBorderColor 	= amphiNormalBorderColor	, activeColor 		= amphiFocusedBGColor	, inactiveColor 	= amphiNormalBGColor 	, activeTextColor 	= amphiFocusedFGColor	, inactiveTextColor 	= amphiNormalFGColor	, decoHeight 		= 16	, fontName 		= amphiFont	}amphiLayoutHook = avoidStruts $ 	showWName $	smartBorders $ 	magnifier (tall) ||| magnifier (Mirror tall) ||| Full ||| noBorders (gimpLayout)	where 	    gimpLayout = combineTwoP (TwoPane 0.04 0.86) (tabbedLayout) (Full) (Not (Role "gimp-toolbox"))	    tall = Tall 1 (3/100) (1/2)	    tabbedLayout = tabbedBottomAlways shrinkText tabbedConf 	amphiManageHook = namedScratchpadManageHook scratchpads  <+> composeAll 	[ className 	=? "MPlayer"		--> doCenterFloat	, (role =? "gimp-toolbox" <||> role =? "gimp-image-window") --> (ask >>= doF . W.sink)	, className 	=? "feh"           	--> doCenterFloat	, className 	=? "Gcolor2"     	--> doCenterFloat	, className 	=? "Gksu"        	--> doCenterFloat	, className 	=? "Grun"        	--> doCenterFloat	, className 	=? "Grandr"        	--> doCenterFloat	, className 	=? "povray"        	--> doCenterFloat	, className 	=? "XFontSel"     	--> doCenterFloat	, className 	=? "Xcolorsel"     	--> doCenterFloat	, className 	=? "Xmag"		--> doCenterFloat	, className 	=? "Reportbug"		--> doCenterFloat	, className 	=? "Stellarium"	  	--> doFullFloat	, role		=? "progress"		--> doCenterFloat	, role		=? "decompose"		--> doCenterFloat	, role		=? "file-jpeg"		--> doCenterFloat	, role		=? "file-png"		--> doCenterFloat	, role		=? "gimp-export-image"		--> doCenterFloat	, role		=? "gimp-image-scale"	--> doCenterFloat	, role		=? "gimp-file-open"	--> doCenterFloat	, role		=? "gimp-file-save"	--> doCenterFloat	, role		=? "gimp-toolbox-color-dialog"	--> doCenterFloat	, (className =? "Gimp" <&&> fmap ("tool" `isSuffixOf`) role) --> doCenterFloat	, title 	=? "Authentication Required"  	--> doCenterFloat -- midori auth window	, title 	=? "HF-Lab"		--> doFloat	, title 	=? "Event Tester"  	--> doFloat	--, className 	=? "Gthumb"	  	--> doFullFloat	, title 	=? "Rename"	  	--> doCenterFloat	, className 	=? "Wicd-client.py"    	--> doCenterFloat	, className 	=? "Xmessage"        	--> doCenterFloat	, className 	=? "Gmessage"        	--> doCenterFloat ]  	where role = stringProperty "WM_WINDOW_ROLE"main = xmonad $ ewmh defaultConfig {   		borderWidth = 1,	    	focusFollowsMouse = True,	    	workspaces 	= ["1","2","3","4","5","6","7","8","9"],     	    	terminal 	= "xfce4-terminal",	    	modMask 	= mod4Mask,	    	manageHook  	= amphiManageHook <+> (isFullscreen --> doFullFloat) <+> manageHook defaultConfig, 	    	layoutHook 	= amphiLayoutHook,		--logHook		= updatePointer (Relative 0.5 0.5) >> fadeInactiveLogHook 0.7,		logHook		= updatePointer (Relative 0.5 0.5),	    	normalBorderColor  = amphiNormalBorderColor,	    	focusedBorderColor = amphiFocusedBorderColor,	    	keys = \c -> amphiKeys c `M.union` keys defaultConfig c,		mouseBindings = amphiMouseBindings	}