[xmonad] Move window to slave on another workspace

Toby Cubitt tsc25 at cantab.net
Sun Sep 18 19:36:29 CEST 2011


On Sun, Sep 18, 2011 at 01:14:09PM -0400, wagnerdm at seas.upenn.edu wrote:
> Quoting Toby Cubitt <tsc25 at cantab.net>:
> 
> > I have keybindings along the lines of
> >
> >   [ ((modMask .|. mod1Mask, k), windows (W.shift i))
> >     | (i, k) <- zip myWorkspaces [xK_F1 .. xK_F12] ]
> >
> > for calling "windows (W.shift i)" to move the current window to a given
> > workspace using Mod+Fn.
> >
> > The problem is, this usually moves the window to the master slot on the
> > target workspace. Whereas I almost invariably want it moved to a slave
> > slot.
> 
> Try this:
> 
>    [ ((modMask .|. mod1Mask, k), windows (onWorkspace i swapDown . W.shift i))
>      | (i, k) <- zip myWorkspaces [xK_F1 .. xK_F12] ]

Thanks, but unfortunately it doesn't seem to work.

First problem is that onWorkspace doesn't seem to be exported by
StackSet. (I'm assuming it's that one you want to use, and not the
onWorkspace from the PerWorkspace contrib module.) For testing purposes,
I copied the onWorkspace definition into my .xmonad (and changed swapDown
to W.swapDown, since I'm importing StackSet qualified).

With these modifications, it compiles without error. But the behaviour is
unchanged. The window is shifted to the master pain of the target
workspace if the focused window on that workspace was the master, or
inserted immediately above the focused window if it's not.  In
particular, if there's only a single window currently on the target
workspace, the shifted window still ends up as the new master.

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: tsc25 at cantab.net
web:   www.dr-qubit.org



More information about the xmonad mailing list