diff options
author | Brent Yorgey <byorgey@cis.upenn.edu> | 2014-04-28 16:29:01 +0200 |
---|---|---|
committer | Brent Yorgey <byorgey@cis.upenn.edu> | 2014-04-28 16:29:01 +0200 |
commit | a48169da57de66e64ffc0e46bf2b363633f06a08 (patch) | |
tree | 2910cecdcdc59db3cfac415f3ac71f7c1c7bed65 /XMonad/Actions | |
parent | 3f513d451d56cef60941727aeb71652df387a624 (diff) | |
download | XMonadContrib-a48169da57de66e64ffc0e46bf2b363633f06a08.tar.gz XMonadContrib-a48169da57de66e64ffc0e46bf2b363633f06a08.tar.xz XMonadContrib-a48169da57de66e64ffc0e46bf2b363633f06a08.zip |
X.Actions.DynamicWorkspaceGroups: export new function addRawWSGroup
Ignore-this: a487882c9571bf91ff921d6561bb4cc6
darcs-hash:20140428142901-1e371-2f3d3c03df35f287a6825008bbe37f08d2a100ab.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r-- | XMonad/Actions/DynamicWorkspaceGroups.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/XMonad/Actions/DynamicWorkspaceGroups.hs b/XMonad/Actions/DynamicWorkspaceGroups.hs index 4bd0679..be457ef 100644 --- a/XMonad/Actions/DynamicWorkspaceGroups.hs +++ b/XMonad/Actions/DynamicWorkspaceGroups.hs @@ -23,6 +23,7 @@ module XMonad.Actions.DynamicWorkspaceGroups WSGroupId + , addRawWSGroup , addWSGroup , addCurrentWSGroup , forgetWSGroup @@ -72,13 +73,20 @@ instance ExtensionClass WSGroupStorage where initialValue = WSG $ M.empty extensionType = PersistentExtension +-- | Add a new workspace group of the given name, mapping to an +-- explicitly specified association between screen IDs and workspace +-- names. This function could be useful for, say, creating some +-- standard workspace groups in your startup hook. +addRawWSGroup :: WSGroupId -> [(ScreenId, WorkspaceId)] -> X () +addRawWSGroup name = XS.modify . withWSG . M.insert name + -- | Add a new workspace group with the given name. addWSGroup :: WSGroupId -> [WorkspaceId] -> X () addWSGroup name wids = withWindowSet $ \w -> do let wss = map ((W.tag . W.workspace) &&& W.screen) $ W.screens w wmap = mapM (strength . (flip lookup wss &&& id)) wids case wmap of - Just ps -> XS.modify . withWSG . M.insert name $ ps + Just ps -> addRawWSGroup name ps Nothing -> return () where strength (ma, b) = ma >>= \a -> return (a,b) |