diff options
Diffstat (limited to '')
-rw-r--r-- | DynamicWorkspaces.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/DynamicWorkspaces.hs b/DynamicWorkspaces.hs index ad003f4..6aad4c5 100644 --- a/DynamicWorkspaces.hs +++ b/DynamicWorkspaces.hs @@ -17,7 +17,7 @@ module XMonadContrib.DynamicWorkspaces ( -- * Usage -- $usage addWorkspace, removeWorkspace, - selectWorkspace, + selectWorkspace, renameWorkspace, toNthWorkspace, withNthWorkspace ) where @@ -38,6 +38,7 @@ import XMonadContrib.XPrompt ( XPConfig ) -- -- > , ((modMask .|. shiftMask, xK_n), selectWorkspace defaultXPConfig layoutHook) -- > , ((modMask .|. shiftMask, xK_BackSpace), removeWorkspace) +-- > , ((modMask .|. shiftMask .|. controlMask, xK_r), renameWorkspace defaultXPConfig) -- -- > -- mod-[1..9] %! Switch to workspace N -- > -- mod-shift-[1..9] %! Move client to workspace N @@ -49,6 +50,13 @@ import XMonadContrib.XPrompt ( XPConfig ) allPossibleTags :: [WorkspaceId] allPossibleTags = map (:"") ['0'..] +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 + toNthWorkspace :: (String -> X ()) -> Int -> X () toNthWorkspace job wnum = do ws <- gets (sort . map tag . workspaces . windowset) case drop wnum ws of |