xmonad-contrib-0.14: Third party extensions for xmonad

Copyright(c) David Roundy <droundy@darcs.net>
LicenseBSD3-style (see LICENSE)
Maintainernone
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98

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 def)
  , ((modm, xK_m                    ), withWorkspace def (windows . W.shift))
  , ((modm .|. shiftMask, xK_m      ), withWorkspace def (windows . copy))
  , ((modm .|. shiftMask, xK_r      ), renameWorkspace def)
-- mod-[1..9]       %! Switch to workspace N in the list of workspaces
-- mod-shift-[1..9] %! Move client to workspace N in the list of workspaces
   ++
   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..])

Alternatively, you can associate indexes (which don't depend of the workspace list order) to workspaces by using following keybindings:

-- mod-[1..9]         %! Switch to workspace of index N
-- mod-control-[1..9] %! Set index N to the current workspace
   ++
   zip (zip (repeat (modm)) [xK_1..xK_9]) (map (withWorkspaceIndex W.greedyView) [1..])
   ++
   zip (zip (repeat (modm .|. controlMask)) [xK_1..xK_9]) (map (setWorkspaceIndex) [1..])

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

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.

appendWorkspace :: String -> X () Source #

Same as addWorkspace, but adds the workspace to the end of the list of workspaces

appendWorkspacePrompt :: XPConfig -> X () Source #

Prompt for the name of a new workspace, appending it to the end of the list of workspaces if it does not already exist, and switch to it.

addWorkspaceAt :: (WindowSpace -> [WindowSpace] -> [WindowSpace]) -> String -> X () Source #

Adds a new workspace with the given name to the current list of workspaces. This function allows the user to pass a function that inserts an element into a list at an arbitrary spot.

removeWorkspace :: X () Source #

Remove the current workspace.

removeWorkspaceByTag :: String -> X () Source #

Remove workspace with specific tag.

removeEmptyWorkspace :: X () Source #

Remove the current workspace if it contains no windows.

removeEmptyWorkspaceByTag :: String -> X () Source #

Remove workspace with specific tag 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.

addHiddenWorkspaceAt :: (WindowSpace -> [WindowSpace] -> [WindowSpace]) -> String -> X () Source #

Add a new hidden workspace with the given name, or do nothing if a workspace with the given name already exists. Takes a function to insert the workspace at an arbitrary spot in the list.

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

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

setWorkspaceIndex :: WorkspaceIndex -> X () Source #

Set the index of the current workspace.

type WorkspaceIndex = Int Source #

The workspace index is mapped to a workspace tag by the user and can be updated.