aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitri Iouchtchenko <johnnyspoon@gmail.com>2012-12-27 07:35:31 +0100
committerDmitri Iouchtchenko <johnnyspoon@gmail.com>2012-12-27 07:35:31 +0100
commit3f57f3a510fa4850c05fed04bcdf841dd9f3092c (patch)
tree6ec30077955c47ff09b852acb5e139d191cfd5f1
parent37686643cbfdc9e015edcba437d744f98cc9d06e (diff)
downloadXMonadContrib-3f57f3a510fa4850c05fed04bcdf841dd9f3092c.tar.gz
XMonadContrib-3f57f3a510fa4850c05fed04bcdf841dd9f3092c.tar.xz
XMonadContrib-3f57f3a510fa4850c05fed04bcdf841dd9f3092c.zip
Add X.A.DynamicWorkspaces.renameWorkspaceByName.
Ignore-this: 4b8aa0405de3969000b1a78eb12992 darcs-hash:20121227063531-7d114-cf51e681da21447cc691be41d313e22fb6337f38.gz
-rw-r--r--XMonad/Actions/DynamicWorkspaces.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/XMonad/Actions/DynamicWorkspaces.hs b/XMonad/Actions/DynamicWorkspaces.hs
index 893dbf7..4451591 100644
--- a/XMonad/Actions/DynamicWorkspaces.hs
+++ b/XMonad/Actions/DynamicWorkspaces.hs
@@ -23,6 +23,7 @@ module XMonad.Actions.DynamicWorkspaces (
addHiddenWorkspace,
withWorkspace,
selectWorkspace, renameWorkspace,
+ renameWorkspaceByName,
toNthWorkspace, withNthWorkspace
) where
@@ -73,11 +74,13 @@ withWorkspace c job = do ws <- gets (workspaces . windowset)
mkXPrompt (Wor "") c (mkCompl ts) job'
renameWorkspace :: XPConfig -> X ()
-renameWorkspace conf = workspacePrompt conf $ \w ->
- windows $ \s -> let sett wk = wk { tag = w }
- setscr scr = scr { workspace = sett $ workspace scr }
- sets q = q { current = setscr $ current q }
- in sets $ removeWorkspace' w s
+renameWorkspace conf = workspacePrompt conf renameWorkspaceByName
+
+renameWorkspaceByName :: String -> X ()
+renameWorkspaceByName w = windows $ \s -> let sett wk = wk { tag = w }
+ setscr scr = scr { workspace = sett $ workspace scr }
+ sets q = q { current = setscr $ current q }
+ in sets $ removeWorkspace' w s
toNthWorkspace :: (String -> X ()) -> Int -> X ()
toNthWorkspace job wnum = do sort <- getSortByIndex