xmonad-contrib-0.11.1: Third party extensions for xmonad

Portabilityunportable
Stabilityunstable
Maintainernone
Safe HaskellNone

XMonad.Actions.DynamicWorkspaces

Contents

Description

Provides bindings to add and delete workspaces.

Synopsis

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 ()Source

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 ()Source

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

removeWorkspace :: X ()Source

Remove the current workspace.

removeEmptyWorkspace :: X ()Source

Remove the current workspace if it contains no windows.

removeEmptyWorkspaceAfter :: X () -> X ()Source

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 ()Source

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

addHiddenWorkspace :: String -> X ()Source

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 ()Source

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