more xmonad.hs cleanup
This commit is contained in:
parent
2b4f1ab84c
commit
af75f133e9
1 changed files with 20 additions and 87 deletions
|
|
@ -30,30 +30,13 @@ import Data.Maybe
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
|
|
||||||
-- The preferred terminal program, which is used in a binding below and by
|
|
||||||
-- certain contrib modules.
|
|
||||||
--
|
|
||||||
-- myTerminal = "urxvt;ps -U $USER |grep dzen2|awk '{print $1}'|xargs kill -USR1"
|
-- myTerminal = "urxvt;ps -U $USER |grep dzen2|awk '{print $1}'|xargs kill -USR1"
|
||||||
|
--
|
||||||
mterminal = "urxvtc"
|
mterminal = "urxvtc"
|
||||||
|
|
||||||
-- Width of the window border in pixels.
|
|
||||||
--
|
|
||||||
mborderWidth = 1
|
mborderWidth = 1
|
||||||
|
|
||||||
-- modMask lets you specify which modkey you want to use. The default
|
|
||||||
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
|
|
||||||
-- ("right alt"), which does not conflict with emacs keybindings. The
|
|
||||||
-- "windows key" is usually mod4Mask.
|
|
||||||
--
|
|
||||||
mmodMask = mod4Mask
|
mmodMask = mod4Mask
|
||||||
|
|
||||||
-- | The default number of workspaces (virtual screens) and their names.
|
|
||||||
-- By default we use numeric strings, but any string may be used as a
|
|
||||||
-- workspace name. The number of workspaces is determined by the length
|
|
||||||
-- of this list.
|
|
||||||
--
|
|
||||||
-- A tagging example:
|
-- A tagging example:
|
||||||
--
|
|
||||||
-- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
|
-- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
|
||||||
--
|
--
|
||||||
mworkspaces :: [WorkspaceId]
|
mworkspaces :: [WorkspaceId]
|
||||||
|
|
@ -65,49 +48,45 @@ mnormalBorderColor = "#999999"
|
||||||
mfocusedBorderColor = "#dd0000"
|
mfocusedBorderColor = "#dd0000"
|
||||||
|
|
||||||
-- Custom keys
|
-- Custom keys
|
||||||
mkeys = [ ("M-S-n", sendMessage MirrorShrink) -- Expand current window
|
--
|
||||||
, ("M-S-t", sendMessage MirrorExpand) -- Shrink current window
|
mkeys = [ ("M-S-n", sendMessage MirrorShrink ) -- Expand current window
|
||||||
|
, ("M-S-t", sendMessage MirrorExpand ) -- Shrink current window
|
||||||
-- Bring dzen to the front
|
, ("M-b" , withFocused toggleBorder ) -- Toggle the border of the currently focused window
|
||||||
, ("M-S-b", spawn "ps -U hunner|grep dzen2|awk '{print $1}'|xargs kill -USR1")
|
, ("M-g" , warpToCentre >> promptedWs) -- Gridselect to pick windows
|
||||||
|
, ("M-S-b", spawn "ps -U hunner|grep dzen2|awk '{print $1}'|xargs kill -USR1") -- Bring dzen to the front
|
||||||
-- Toggle the border of the currently focused window
|
|
||||||
, ("M-b" , withFocused toggleBorder)
|
|
||||||
|
|
||||||
-- Gridselect to pick windows
|
|
||||||
--, ((modMask , xK_g ), goToSelected defaultGSConfig)
|
|
||||||
--, ((modMask , xK_g ), goToSelected gsconfig3)
|
|
||||||
--, ("M-g" , warpToCentre >> wsgrid)
|
|
||||||
--, ("M-g" , wsgrid)
|
|
||||||
, ("M-g" , warpToCentre >> promptedWs)
|
|
||||||
|
|
||||||
-- Goes to window or bring up window
|
-- Goes to window or bring up window
|
||||||
, ("M-S-g", gotoMenu)
|
--, ("M-S-g", gotoMenu)
|
||||||
, ("M-S-b", bringMenu)
|
--, ("M-S-b", bringMenu)
|
||||||
|
, ("M-S-g", warpToCentre >> goToSelected gsConfig )
|
||||||
|
|
||||||
-- Multimedia
|
-- Multimedia
|
||||||
, ("<XF86AudioPlay>" , spawn "mpc toggle" ) -- play/pause mpd
|
, ("<XF86AudioPlay>" , spawn "mpc toggle" ) -- play/pause mpd
|
||||||
, ("<XF86AudioStop>" , spawn "mpc stop" ) -- stop mpd
|
, ("<XF86AudioStop>" , spawn "mpc stop" ) -- stop mpd
|
||||||
, ("<XF86AudioPrev>" , spawn "mpc prev" ) -- prev song
|
, ("<XF86AudioPrev>" , spawn "mpc prev" ) -- prev song
|
||||||
, ("<XF86AudioNext>" , spawn "mpc next" ) -- next song
|
, ("<XF86AudioNext>" , spawn "mpc next" ) -- next song
|
||||||
, ("<XF86AudioMute>" , spawn "amixer -q -- sset Headphone togglemute") -- toggle mute via custom script
|
|
||||||
, ("<XF86AudioLowerVolume>", spawn "mpc volume -3" ) -- volume down via custom script
|
, ("<XF86AudioLowerVolume>", spawn "mpc volume -3" ) -- volume down via custom script
|
||||||
, ("<XF86AudioRaiseVolume>", spawn "mpc volume +3" ) -- volume up via custom script
|
, ("<XF86AudioRaiseVolume>", spawn "mpc volume +3" ) -- volume up via custom script
|
||||||
, ("M-S-<Backspace>" , removeWorkspace)
|
, ("<XF86AudioMute>" , spawn "amixer -q -- sset Headphone togglemute") -- toggle mute via custom script
|
||||||
|
|
||||||
-- Dynamic workspace commands
|
-- Dynamic workspace commands
|
||||||
|
, ("M-S-<Backspace>" , removeWorkspace)
|
||||||
, ("M-S-w" , selectWorkspace myXPConfig)
|
, ("M-S-w" , selectWorkspace myXPConfig)
|
||||||
|
, ("M-S-r" , renameWorkspace myXPConfig)
|
||||||
, ("M-m" , withWorkspace myXPConfig (windows . W.shift))
|
, ("M-m" , withWorkspace myXPConfig (windows . W.shift))
|
||||||
, ("M-S-m" , withWorkspace myXPConfig (windows . copy))
|
, ("M-S-m" , withWorkspace myXPConfig (windows . copy))
|
||||||
, ("M-S-r" , renameWorkspace myXPConfig)
|
|
||||||
]
|
]
|
||||||
-- Don't auto-assign the key shortcuts
|
-- Don't auto-assign the key shortcuts
|
||||||
-- ++
|
-- ++
|
||||||
-- zip (map (("M-" ++) . show) [1..9]) (map (withNthWorkspace W.greedyView) [0..])
|
-- zip (map (("M-" ++) . show) [1..9]) (map (withNthWorkspace W.greedyView) [0..])
|
||||||
-- ++
|
-- ++
|
||||||
-- zip (map (("M-S-" ++) . show) [1..9]) (map (withNthWorkspace W.shift) [0..])
|
-- zip (map (("M-S-" ++) . show) [1..9]) (map (withNthWorkspace W.shift) [0..])
|
||||||
|
where -- Make the mouse jump to the middle of the screen for gridselect
|
||||||
|
warpToCentre = gets (W.screen . W.current . windowset) >>= \x -> warpToScreen x 0.5 0.5
|
||||||
|
promptedWs = wsgrid >>= \x -> whenJust x $ \y -> windows $ W.greedyView y
|
||||||
|
wsgrid = gridselect gsConfig =<< gets (map (\x -> (x,x)) . (map W.tag . W.workspaces . windowset))
|
||||||
|
--wsgrid = gridselect gsConfig =<< gets (map (\x -> (x,x)) . (map W.tag . uncurry (++) . partition (isJust . W.stack) . W.workspaces . windowset)) -- (map W.tag . W.workspaces . windowset))
|
||||||
|
|
||||||
warpToCentre = gets (W.screen . W.current . windowset) >>= \x -> warpToScreen x 0.5 0.5
|
|
||||||
|
|
||||||
{-
|
{-
|
||||||
[10:28] dschoepe : gets (map W.tag . W.workspaces . windowset) should work
|
[10:28] dschoepe : gets (map W.tag . W.workspaces . windowset) should work
|
||||||
|
|
@ -118,10 +97,6 @@ warpToCentre = gets (W.screen . W.current . windowset) >>= \x -> warpToScreen x
|
||||||
[10:34] aavogt : needs imports of Data.List and Data.Maybe
|
[10:34] aavogt : needs imports of Data.List and Data.Maybe
|
||||||
-}
|
-}
|
||||||
|
|
||||||
--wsgrid = gridselect gsConfig =<< gets (map (\x -> (x,x)) . (map W.tag . uncurry (++) . partition (isJust . W.stack) . W.workspaces . windowset)) -- (map W.tag . W.workspaces . windowset))
|
|
||||||
wsgrid = gridselect gsConfig =<< gets (map (\x -> (x,x)) . (map W.tag . W.workspaces . windowset))
|
|
||||||
promptedWs = wsgrid >>= \x -> whenJust x $ \y -> windows $ W.greedyView y
|
|
||||||
|
|
||||||
{-
|
{-
|
||||||
- Fancy gsConfig
|
- Fancy gsConfig
|
||||||
gsConfig = defaultGSConfig { gs_navigate = neiu `M.union` gs_navigate (defaultGSConfig`asTypeOf`gsConfig) }
|
gsConfig = defaultGSConfig { gs_navigate = neiu `M.union` gs_navigate (defaultGSConfig`asTypeOf`gsConfig) }
|
||||||
|
|
@ -153,34 +128,9 @@ gsConfig = defaultGSConfig
|
||||||
-- jump back to the center with the spacebar, regardless of the current position.
|
-- jump back to the center with the spacebar, regardless of the current position.
|
||||||
reset = M.singleton (0,xK_space) (const (0,0))
|
reset = M.singleton (0,xK_space) (const (0,0))
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
|
||||||
-- Mouse bindings: default actions bound to mouse events
|
|
||||||
--
|
|
||||||
mmouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
|
|
||||||
|
|
||||||
-- mod-button1, Set the window to floating mode and move by dragging
|
|
||||||
[ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w))
|
|
||||||
|
|
||||||
-- mod-button2, Raise the window to the top of the stack
|
|
||||||
, ((modMask, button2), (\w -> focus w >> windows W.swapMaster))
|
|
||||||
|
|
||||||
-- mod-button3, Set the window to floating mode and resize by dragging
|
|
||||||
, ((modMask, button3), (\w -> focus w >> mouseResizeWindow w))
|
|
||||||
|
|
||||||
-- you may also bind events to the mouse scroll wheel (button4 and button5)
|
|
||||||
]
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- Layouts:
|
-- Layouts:
|
||||||
|
|
||||||
-- You can specify and transform your layouts by modifying these values.
|
|
||||||
-- If you change layout bindings be sure to use 'mod-shift-space' after
|
|
||||||
-- restarting (with 'mod-q') to reset your layout state to the new
|
|
||||||
-- defaults, as xmonad preserves your old layout settings by default.
|
|
||||||
--
|
|
||||||
-- The available layouts. Note that each layout is separated by |||,
|
|
||||||
-- which denotes layout choice.
|
|
||||||
--
|
|
||||||
mlayout = smartBorders Full ||| tiled ||| Mirror tiled ||| simplestFloat
|
mlayout = smartBorders Full ||| tiled ||| Mirror tiled ||| simplestFloat
|
||||||
where
|
where
|
||||||
-- default tiling algorithm partitions the screen into two panes
|
-- default tiling algorithm partitions the screen into two panes
|
||||||
|
|
@ -191,26 +141,15 @@ mlayout = smartBorders Full ||| tiled ||| Mirror tiled ||| simplestFloat
|
||||||
nmaster = 1
|
nmaster = 1
|
||||||
|
|
||||||
-- Default proportion of screen occupied by master pane
|
-- Default proportion of screen occupied by master pane
|
||||||
ratio = 1/2
|
--ratio = 1/2
|
||||||
--ratio = toRational (2/(1+sqrt(5)::Double)) -- golden
|
ratio = toRational (2/(1+sqrt(5)::Double)) -- golden
|
||||||
|
|
||||||
-- Percent of screen to increment by when resizing panes
|
-- Percent of screen to increment by when resizing panes
|
||||||
delta = 3/100
|
delta = 3/100
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- Window rules:
|
-- Window rules:
|
||||||
|
|
||||||
-- Execute arbitrary actions and WindowSet manipulations when managing
|
|
||||||
-- a new window. You can use this to, for example, always float a
|
|
||||||
-- particular program, or have a client always appear on a particular
|
|
||||||
-- workspace.
|
|
||||||
--
|
|
||||||
-- To find the property name associated with a program, use
|
|
||||||
-- > xprop | grep WM_CLASS
|
-- > xprop | grep WM_CLASS
|
||||||
-- and click on the client you're interested in.
|
|
||||||
--
|
|
||||||
-- To match on the WM_NAME, you can use 'title' in the same way that
|
|
||||||
-- 'className' and 'resource' are used below.
|
|
||||||
--
|
--
|
||||||
mmanageHook = composeAll
|
mmanageHook = composeAll
|
||||||
[ className =? "MPlayer" --> doFloat
|
[ className =? "MPlayer" --> doFloat
|
||||||
|
|
@ -234,7 +173,6 @@ mfocusFollowsMouse = True
|
||||||
{-
|
{-
|
||||||
[14:25] dschoepe : Hunner: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=8798#a8798
|
[14:25] dschoepe : Hunner: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=8798#a8798
|
||||||
[14:25] dschoepe : that should work in darcs
|
[14:25] dschoepe : that should work in darcs
|
||||||
[14:27] Hunner : awesome. I'll check it
|
|
||||||
[14:28] dschoepe : Hunner: you probably want something like `flip
|
[14:28] dschoepe : Hunner: you probably want something like `flip
|
||||||
(/="cellwriterclass") `fmap` className' as shouldFollow
|
(/="cellwriterclass") `fmap` className' as shouldFollow
|
||||||
[14:28] dschoepe : err, without the flip
|
[14:28] dschoepe : err, without the flip
|
||||||
|
|
@ -262,11 +200,6 @@ main = do
|
||||||
, workspaces = mworkspaces
|
, workspaces = mworkspaces
|
||||||
, normalBorderColor = mnormalBorderColor
|
, normalBorderColor = mnormalBorderColor
|
||||||
, focusedBorderColor = mfocusedBorderColor
|
, focusedBorderColor = mfocusedBorderColor
|
||||||
|
|
||||||
-- key bindings
|
|
||||||
, mouseBindings = mmouseBindings
|
|
||||||
|
|
||||||
-- hooks, layouts
|
|
||||||
, layoutHook = mlayout
|
, layoutHook = mlayout
|
||||||
, manageHook = mmanageHook
|
, manageHook = mmanageHook
|
||||||
, handleEventHook = pickyFocusEventHook
|
, handleEventHook = pickyFocusEventHook
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue