Move window to slave on another workspace

Hi, 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. There must be a way of modifying the command so that it always moves the window to the slave, but my Haskell chops aren't up to figuring out how. As far as I understand it, shift always inserts the moved window directly above the focused window on the target workspace. If the focused window was the master, then the shifted window becomes the new master I think inserting it directly below the focuses window would probably have the desired effect, since presumably a new window below the focused one can never end up as the master. But I don't understand XMonad stacksets anywhere near well enough to figure out how to write a version of shift that does what I want. Or am I barking up the wrong tree? Can anyone help with this? Toby -- Dr T. S. Cubitt Mathematics and Quantum Information group Department of Mathematics Complutense University Madrid, Spain email: tsc25@cantab.net web: www.dr-qubit.org

Quoting Toby Cubitt
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] ] ~d

On Sun, Sep 18, 2011 at 01:14:09PM -0400, wagnerdm@seas.upenn.edu wrote:
Quoting Toby Cubitt
: 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@cantab.net web: www.dr-qubit.org
participants (2)
-
Toby Cubitt
-
wagnerdm@seas.upenn.edu