From a48169da57de66e64ffc0e46bf2b363633f06a08 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Mon, 28 Apr 2014 16:29:01 +0200 Subject: X.Actions.DynamicWorkspaceGroups: export new function addRawWSGroup Ignore-this: a487882c9571bf91ff921d6561bb4cc6 darcs-hash:20140428142901-1e371-2f3d3c03df35f287a6825008bbe37f08d2a100ab.gz --- XMonad/Actions/DynamicWorkspaceGroups.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'XMonad') 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) -- cgit v1.2.3