On Thu, Aug 8, 2013 at 11:28 AM, Rhys Ulerich <rhys.ulerich@gmail.com> wrote:
I'd like to achieve an action like 'shiftTo Next EmptyWS >>
andThenSomehowFollow'.  The goal is to move the window to the next
empty workspace and then to follow it there.

My silly attempts with
    , ((modm .|. shiftMask, xK_Down), followTo Next EmptyWS)
using
  followTo d = shiftTo d >> moveTo d
don't work.  I suspect this is because I'm not properly saving the
Next EmptyWS result prior to mutating the state.

IIRC you can't easily get at the workspace it chooses, and of course after the window is shifted it's no longer empty.

Better is to do it the other way around:

    import qualified XMonad.StackSet as W
    
    {- ... -}
    
    followTo which wsel = withFocused $ \w -> do
      moveTo which wsel
      here <- gets $ tag . workspace . current . windowset
      windows $ W.shift here w

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net