xmonad-contrib-0.10: Third party extensions for xmonad

Portability | unportable
Stability | unstable
Maintainer | none

XMonad.Actions.DynamicWorkspaces

Contents

- Usage

Description

Provides bindings to add and delete workspaces.

Synopsis

- addWorkspace :: String -> X ()
- addWorkspacePrompt :: XPConfig -> X ()
- removeWorkspace :: X ()
- removeEmptyWorkspace :: X ()
- removeEmptyWorkspaceAfter :: X () -> X ()
- removeEmptyWorkspaceAfterExcept :: [String] -> X () -> X ()
- addHiddenWorkspace :: String -> X ()
- withWorkspace :: XPConfig -> (String -> X ()) -> X ()
- selectWorkspace :: XPConfig -> X ()
- renameWorkspace :: XPConfig -> X ()
- toNthWorkspace :: (String -> X ()) -> Int -> X ()
- withNthWorkspace :: (String -> WindowSet -> WindowSet) -> Int -> X ()

# Usage

You can use this module with the following in your `~/.xmonad/xmonad.hs` file:

     import XMonad.Actions.DynamicWorkspaces
     import XMonad.Actions.CopyWindow(copy)

Then add keybindings like the following:

       , ((modm .|. shiftMask, xK_BackSpace), removeWorkspace)
       , ((modm .|. shiftMask, xK_v      ), selectWorkspace defaultXPConfig)
       , ((modm, xK_m                    ), withWorkspace defaultXPConfig (windows . W.shift))
       , ((modm .|. shiftMask, xK_m      ), withWorkspace defaultXPConfig (windows . copy))
       , ((modm .|. shiftMask, xK_r      ), renameWorkspace defaultXPConfig)

     -- mod-[1..9]       %! Switch to workspace N
     -- mod-shift-[1..9] %! Move client to workspace N
        ++
        zip (zip (repeat (modm)) [xK_1..xK_9]) (map (withNthWorkspace W.greedyView) [0..])
        ++
        zip (zip (repeat (modm .|. shiftMask)) [xK_1..xK_9]) (map (withNthWorkspace W.shift) [0..])

For detailed instructions on editing your key bindings, see XMonad.Doc.Extending. See also the documentation for XMonad.Actions.CopyWindow, `windows`, `shift`, and `defaultXPConfig`.

addWorkspace :: String -> X ()

Add a new workspace with the given name, or do nothing if a workspace with the given name already exists; then switch to the newly created workspace.

addWorkspacePrompt :: XPConfig -> X ()

Prompt for the name of a new workspace, add it if it does not already exist, and switch to it.

removeWorkspace :: X ()

Remove the current workspace.

removeEmptyWorkspace :: X ()

Remove the current workspace if it contains no windows.

removeEmptyWorkspaceAfter :: X () -> X ()

Remove the current workspace after an operation if it is empty and hidden. Can be used to remove a workspace if it is empty when leaving it. The operation may only change workspace once, otherwise the workspace will not be removed.

removeEmptyWorkspaceAfterExcept :: [String] -> X () -> X ()

Like `removeEmptyWorkspaceAfter` but use a list of sticky workspaces, whose entries will never be removed.

addHiddenWorkspace :: String -> X ()

Add a new hidden workspace with the given name, or do nothing if a workspace with the given name already exists.

withWorkspace :: XPConfig -> (String -> X ()) -> X ()

selectWorkspace :: XPConfig -> X ()

renameWorkspace :: XPConfig -> X ()

toNthWorkspace :: (String -> X ()) -> Int -> X ()

withNthWorkspace :: (String -> WindowSet -> WindowSet) -> Int -> X ()