xmonad-contrib-0.17.1: Community-maintained extensions for xmonad

Copyright | (c) Devin Mullins <me@twifkak.com>
License | BSD3-style (see LICENSE)
Maintainer | Devin Mullins <me@twifkak.com>
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

XMonad.Actions.SwapWorkspaces

Contents

- Usage

Description

Lets you swap workspace tags, so you can keep related ones next to each other, without having to move individual windows.

Synopsis

- swapWithCurrent :: Eq i => i -> StackSet i l a s sd -> StackSet i l a s sd
- swapTo :: Direction1D -> X ()
- swapWorkspaces :: Eq i => i -> i -> StackSet i l a s sd -> StackSet i l a s sd
- data Direction1D
  - = Next
  - | Prev

# Usage

Add this import to your `~/.xmonad/xmonad.hs`:

    import XMonad.Actions.SwapWorkspaces

Then throw something like this in your keys definition:

    ++
    [((modm .|. controlMask, k), windows $ swapWithCurrent i)
        | (i, k) <- zip workspaces [xK_1 ..]]

After installing this update, if you're on workspace 1, hitting mod-ctrl-5 will swap workspaces 1 and 5.

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

swapWithCurrent :: Eq i => i -> StackSet i l a s sd -> StackSet i l a s sd Source #

Swaps the currently focused workspace with the given workspace tag, via `swapWorkspaces`.

swapTo :: Direction1D -> X () Source #

Say `swapTo Next` or `swapTo Prev` to move your current workspace. This is an `X ()` so can be hooked up to your keybindings directly.

swapWorkspaces :: Eq i => i -> i -> StackSet i l a s sd -> StackSet i l a s sd Source #

Takes two workspace tags and an existing XMonad.StackSet and returns a new one with the two corresponding workspaces' tags swapped.

data Direction1D Source #

One-dimensional directions:

Constructors

Next |
Prev |

#### Instances

Instances details

Read Direction1D Source # |
Instance details Defined in XMonad.Util.Types Methods readsPrec :: Int -> ReadS Direction1D Source # readList :: ReadS [Direction1D] Source # readPrec :: ReadPrec Direction1D Source # readListPrec :: ReadPrec [Direction1D] Source #
Show Direction1D Source # |
Instance details Defined in XMonad.Util.Types Methods showsPrec :: Int -> Direction1D -> ShowS Source # show :: Direction1D -> String Source # showList :: [Direction1D] -> ShowS Source #
Eq Direction1D Source # |
Instance details Defined in XMonad.Util.Types Methods (==) :: Direction1D -> Direction1D -> Bool Source # (/=) :: Direction1D -> Direction1D -> Bool Source #