xmonad-contrib-0.5: Third party extensions for xmonadSource codeContentsIndex
MaintainerDavid Roundy <droundy@darcs.net>
Provides a binding to duplicate a window on multiple workspaces, providing dwm-like tagging functionality.
copy :: WorkspaceId -> WindowSet -> WindowSet
copyWindow :: Window -> WorkspaceId -> WindowSet -> WindowSet
kill1 :: X ()

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

 import XMonad.Actions.CopyWindow

Then add something like this to your keybindings:

 -- mod-[1..9] @@ Switch to workspace N
 -- mod-shift-[1..9] @@ Move client to workspace N
 -- mod-control-shift-[1..9] @@ Copy client to workspace N
 [((m .|. modMask x, k), windows $ f i)
     | (i, k) <- zip (workspaces x) [xK_1 ..]
     , (f, m) <- [(W.view, 0), (W.shift, shiftMask), (copy, shiftMask .|. controlMask)]]

To use the above key bindings you need also to import XMonad.StackSet:

 import qualified XMonad.StackSet as W

You may also wish to redefine the binding to kill a window so it only removes it from the current workspace, if it's present elsewhere:

  , ((modMask x .|. shiftMask, xK_c     ), kill1) -- @@ Close the focused window

For detailed instructions on editing your key bindings, see XMonad.Doc.Extending#Editing_key_bindings.

copy :: WorkspaceId -> WindowSet -> WindowSetSource
copy. Copy the focussed window to a new workspace.
copyWindow :: Window -> WorkspaceId -> WindowSet -> WindowSetSource
copyWindow. Copy a window to a new workspace
kill1 :: X ()Source

Remove the focused window from this workspace. If it's present in no other workspace, then kill it instead. If we do kill it, we'll get a delete notify back from X.

There are two ways to delete a window. Either just kill it, or if it supports the delete protocol, send a delete event (e.g. firefox)

Produced by Haddock version 2.3.0