SwapMaster (DwmPromote) and Stack reordering (was: Re: [xmonad] Newbie: Problems with Layouts and Syntax)

lithis xmonad at s001.hethrael.com
Fri Mar 14 22:31:57 EDT 2008


On Mon, 2008/03/03 10:20:01 +0100, john spencer wrote:
> Well - one thing I'd like to change: Instead of swapping I'd like to put
> the current master on top of the stack;

I had wanted this for a while too; you got me to do
something about it.

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 [] (ys ++ rs) where ys = reverse ls

I added it to DwmPromote.hs and added “, promote” after line
22 (the first occurance of “dwmpromote”), but it could
probably go right in your xmonad.hs (make sure you import
XMonad.StackSet).

I would send a darcs patch, but I don’t know where it should
go. A new module seems overkill, the name DwmPromote doesn’t
apply to it, and renaming DwmPromote.hs to Promote.hs would
break peoples’ setups.


More information about the xmonad mailing list