aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorDaniel Schoepe <daniel.schoepe@gmail.com>2009-11-09 16:58:15 +0100
committerDaniel Schoepe <daniel.schoepe@gmail.com>2009-11-09 16:58:15 +0100
commitb6956d20340d180fb99afcbdbdef24d10edb1a4c (patch)
tree5ce48a1ee14fa01b431dfccbe38ce809d7b4eeea /XMonad
parenta242a6a4a9f9f202ba1ac8aeff48ae81d29073d5 (diff)
downloadXMonadContrib-b6956d20340d180fb99afcbdbdef24d10edb1a4c.tar.gz
XMonadContrib-b6956d20340d180fb99afcbdbdef24d10edb1a4c.tar.xz
XMonadContrib-b6956d20340d180fb99afcbdbdef24d10edb1a4c.zip
Add gridselectViewWorkspace in X.A.GridSelect
Ignore-this: 5543211e9e3fd325cb798b004635a525 darcs-hash:20091109155815-7f603-3268ca3679728a4493365b98bdfef4066f8fef0f.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Actions/GridSelect.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/XMonad/Actions/GridSelect.hs b/XMonad/Actions/GridSelect.hs
index 0419f7c..2e77193 100644
--- a/XMonad/Actions/GridSelect.hs
+++ b/XMonad/Actions/GridSelect.hs
@@ -38,6 +38,7 @@ module XMonad.Actions.GridSelect (
withSelectedWindow,
bringSelected,
goToSelected,
+ gridselectViewWorkspace,
spawnSelected,
runSelectedAction,
@@ -520,3 +521,11 @@ runSelectedAction conf actions = do
case selectedActionM of
Just selectedAction -> selectedAction
Nothing -> return ()
+
+-- | Select a workspace and view it using the given function
+-- (normally 'W.view' or 'W.greedyView')
+gridselectViewWorkspace :: GSConfig WorkspaceId ->
+ (WorkspaceId -> WindowSet -> WindowSet) -> X ()
+gridselectViewWorkspace conf viewFunc = withWindowSet $ \ws -> do
+ let wss = map W.tag $ W.hidden ws ++ map W.workspace (W.current ws : W.visible ws)
+ gridselect conf (zip wss wss) >>= flip whenJust (windows . viewFunc) \ No newline at end of file