[xmonad] Wanting to do a window-shift in a event handler

Michael Norrish Michael.Norrish at nicta.com.au
Mon May 2 03:36:33 CEST 2011


On 02/05/11 11:20, Brandon S Allbery KF8NH wrote:
> On 5/1/11 20:28 , Michael Norrish wrote:
>> Through calls to trace, I can see that I am indeed picking up on
>> the desired event (the change in the window's name), and I have a
>> window (w above) to hand, but I don't know how to do things to it.
>> My cursory examination of the relevant APIs suggested I could do

>> action <- runQuery (doShift "mail") w

>> giving me a handle on an Endo Windowset, but I don't know how to
>> lift that into the X monad (where I have to eventually return $ All
>> True).  Can I use the withWindowSet function somehow?

> I saw you asking about this in #xmonad and left a response message,
> but I guess you never checked back in.  You want to do something
> like

> windows (W.shift "mail" w)

> which reruns the layout with the specified modification.

This doesn't quite work because w is a Window, not a WindowSet.  However, the following does appear to do the right thing

  action <- runQuery (doShift "mail") w
  windows (appEndo action)

It still seems a bit on the convoluted side.   Is there a way of getting an appropriate WindowSet from the w :: Window that I do have?

Best,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20110502/6f5f793e/attachment-0001.pgp>


More information about the xmonad mailing list