[xmonad] run a program when switching to a workspace

Sergey Manucharian sergey at ingeniware.com
Fri May 29 13:29:10 EDT 2009


On Thu, 28 May 2009 10:50:34 +0300
Roman Cheplyaka <roma at ro-che.info> wrote:

> * Brent Yorgey <byorgey at seas.upenn.edu> [2009-05-27 22:52:04-0400]
> .......
> >   ...
> >   logHook = ...other stuff... >> checkKBLayout
> > 
> >   ...
> > 
> >   checkKBLayout :: X ()
> >   checkKBLayout = do
> >     curTag <- gets (W.currentTag . windowset)
> >     when (curTag == "foo") $ spawn "set keyboard layout"
> .......
> 
> Just to make it clear: the command will be spawned each time when
> windowset changes -- e.g. when you change the focus. It's harmless
> with setting kb layout, but if you use it for e.g. launching an
> application you'll get a new instance each time you change focus.

I wonder why it keeps and keeps spawning the program even if I stay on
that workspace....

Cheers,
Sergey


More information about the xmonad mailing list