diff options
author | xmonad <xmonad@s001.hethrael.com> | 2008-03-16 21:57:22 +0100 |
---|---|---|
committer | xmonad <xmonad@s001.hethrael.com> | 2008-03-16 21:57:22 +0100 |
commit | b1f9bbf3586a74a3539251b35680aa6f8e159421 (patch) | |
tree | 720149a0fc49fba3c07b7f1271ea500353ee8f89 | |
parent | a330858938875a5f8d8598852f2a31a7625f3330 (diff) | |
download | XMonadContrib-b1f9bbf3586a74a3539251b35680aa6f8e159421.tar.gz XMonadContrib-b1f9bbf3586a74a3539251b35680aa6f8e159421.tar.xz XMonadContrib-b1f9bbf3586a74a3539251b35680aa6f8e159421.zip |
Add XMonad.Actions.Promote
darcs-hash:20080316205722-a910a-ef6c0d20e5267c6ddcb92cdd089722bc195c3daa.gz
-rw-r--r-- | XMonad/Actions/Promote.hs | 49 | ||||
-rw-r--r-- | xmonad-contrib.cabal | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/XMonad/Actions/Promote.hs b/XMonad/Actions/Promote.hs new file mode 100644 index 0000000..0d270d3 --- /dev/null +++ b/XMonad/Actions/Promote.hs @@ -0,0 +1,49 @@ +----------------------------------------------------------------------------- +-- | +-- Module : XMonad.Actions.Promote +-- Copyright : (c) Miikka Koskinen 2007 +-- License : BSD3-style (see LICENSE) +-- +-- Maintainer : xmonad@s001.ethrael.com +-- Stability : unstable +-- Portability : unportable +-- +-- Alternate promote function for xmonad. +-- +-- Moves the focused window to the master pane. All other windows +-- retain their order. If focus is in the master, swap it with the +-- next window in the stack. Focus stays in the master. +-- +----------------------------------------------------------------------------- + +module XMonad.Actions.Promote ( + -- * Usage + -- $usage + promote + ) where + +import XMonad +import XMonad.StackSet + +-- $usage +-- +-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: +-- +-- > import XMonad.Actions.Promote +-- +-- then add a keybinding or substitute 'promote' in place of swapMaster: +-- +-- > , ((modMask x, xK_Return), promote) +-- +-- For detailed instructions on editing your key bindings, see +-- "XMonad.Doc.Extending#Editing_key_bindings". + +-- | Move the focused window to the master pane. All other windows +-- retain their order. If focus is in the master, swap it with the +-- next windo in the stack. Focus stays in the master. +promote :: X () +promote = windows $ modify' $ + \c -> case c of + Stack _ [] [] -> c + Stack t [] (x:rs) -> Stack x [] (t:rs) + Stack t ls rs -> Stack t [] (reverse ls ++ rs) diff --git a/xmonad-contrib.cabal b/xmonad-contrib.cabal index 1fb5420..250eb07 100644 --- a/xmonad-contrib.cabal +++ b/xmonad-contrib.cabal @@ -84,6 +84,7 @@ library XMonad.Actions.MouseResize XMonad.Actions.NoBorders XMonad.Actions.PerWorkspaceKeys + XMonad.Actions.Promote XMonad.Actions.RotSlaves XMonad.Actions.Search XMonad.Actions.SimpleDate |