diff options
author | David Roundy <droundy@darcs.net> | 2007-10-18 16:56:04 +0200 |
---|---|---|
committer | David Roundy <droundy@darcs.net> | 2007-10-18 16:56:04 +0200 |
commit | 8ddc675faa186c4585b7c4b6df93861bd4b16b05 (patch) | |
tree | 683ff647dc7d6a94f07497c57023aba956caa9e6 | |
parent | f046e1203bd519d623438f7ca4efeabc8b41aa6e (diff) | |
download | XMonadContrib-8ddc675faa186c4585b7c4b6df93861bd4b16b05.tar.gz XMonadContrib-8ddc675faa186c4585b7c4b6df93861bd4b16b05.tar.xz XMonadContrib-8ddc675faa186c4585b7c4b6df93861bd4b16b05.zip |
add function to rename workspaces.
darcs-hash:20071018145604-72aca-d28097e49bc8ba0a939dcc87cbd6fd791682494b.gz
-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 |