[xmonad] Hello, and firefox

Devin Mullins me at twifkak.com
Fri Jun 13 00:55:40 EDT 2008

On Thu, Jun 12, 2008 at 06:22:02PM -0700, David Roundy wrote:
> A hokier but simpler approach (if you plan on always leaving a firefox
> window open on workspace 2) would be to simply check if there are any
> windows in workspace 2.

So, in addition to this approach, I can think of two others:

1. startupHook is run just after windows have been mapped (see the
definition of xmonad in XMonad/Main.hsc), so you can check for any
existing Firefox windows there and only there. At that point, you could
either iterate over all windows and runQuery a special ManageHook that's
not part of your usual manageHook, or use XMonad.Util.WindowProperties.
(I'm not sure which is better.)

2. The cooler (but much harder) option would be something like
XMonad.Hooks.ServerMode. You'd establish an EventHook that listened for
a "shift-to-workspace" ClientMessageEvent. Then, you'd write a custom
X11 client that looked up the Firefox window and sent the appropriate
ClientMessage to the root window.

Ideally, this could be generalized to something I've wanted to see: a
`float` command that ran $*, tracked all of the windows it spawned, and
asked xmonad to float them. (I'm not sure if that's possible, though.
And, yes, I know you didn't want to float. I'm digressing.)

Disclaimer: I may be on crack.

More information about the xmonad mailing list