[xmonad] Windows staying put on their workspace

Александър Л. Димитров aleks_d at gmx.de
Sat Jul 12 09:59:57 EDT 2008

Hi Jvin,

> 1) I'm finding that windows are popping up on my current workspace
> when they were generated by a window in a different workspace.  These
> are very distracting.  I'd like them to stay over there.

Well, I think so far the only answer to your first request is contained in the
answer to your second request. Read on

> 2) Right now, if I launch a big application (say, amarok or
> openoffice) on a workspace and change workspaces the window will pop
> up on the second workspace I am at now.  Instead, I'd like to launch
> the application on it's own workspace, then go to a different
> workspace to do some work then come back after it's launched.

You can use the ManageHook to achieve this. You can define your own ManageHook
like this:

myManageHook = composeAll
    [ className =? "MPlayer"        --> doFloat
    , className =? "Firefox"        --> doF (W.shift wsWeb)
    , className =? "Eclipse"        --> doF (W.shift wsCode')
    , className =? "Opera"  »···    --> doF (W.shift wsDoc)
    , className =? "Gimp"           --> doFloat
    , className =? "Gimp"           --> doF (W.shift "7")
    , resource  =? "desktop_window" --> doIgnore
    , resource  =? "kdesktop"       --> doIgnore ]
    <+> manageDocks

By just adding another className =? "Something" --> doF(W.shift aWorkSpace)
where aWorkSpace is one of your work spaces (like 1 2 3 4 ...) you can force all
windows with a particular window class name to pop up on that work space. This
(typically) includes message dialogs, or new windows (can work for gaim^Wpidgin,

You can find out the class name of a window like this:

xprop | grep WM_CLASS

and then click on the window. This is documented in the standard xmonad.hs file.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/xmonad/attachments/20080712/d63fe398/attachment.bin

More information about the xmonad mailing list