[xmonad] Manage hooks

Norbert Zeh nzeh at cs.dal.ca
Tue Dec 20 21:02:44 CET 2011


adam vogt [2011.12.20 1447 -0500]:
> On Mon, Dec 19, 2011 at 12:41 PM, Norbert Zeh <nzeh at cs.dal.ca> wrote:
> > Hi folks,
> >
> > before I go and code this up myself, let me make sure it doesn't exist yet.  I
> > want two features of managehooks:
> >
> > - Display a certain type of window (say emacs) on a certain screen (screen, not
> >  workspace)
> >
> > - Toggle manage hooks (e.g., using a key binding).  As an example, I normally
> >  want no special handling of emacs windows, but for certain tasks I want every
> >  emacs window to pop up on my left screen.  Since I do not want to reconfigure
> >  and restart xmonad every time the context changes, I need to be able to
> >  activate/deactivate certain manage hooks.
> >
> > Ah, I actually just found X.H.DynamicHooks, which seems to go at least part of
> > the way for the second bullet above.  The first question remains.
> >
> > If the above functionality does not exist yet, I'd provide the first as a patch
> > for X.H.ManageHelpers and the second either as a patch for X.H.DynamicHooks or
> > as a separate module, depending on how incremental the change turns out to be.
> > Does this sound reasonable?
> 
> Hi Norbert,
> 
> I'm not aware of anything in contrib addressing your first point. But
> adding it should be fairly straightforward, considering you can
> define:
> 
> doShiftScreen :: ScreenId -> ManageHook
> doShiftScreen screenId = flip whenJust doShift =<< liftX
> (screenWorkspace screenId) -- fairly sure this typechecks
> 
> And then use it exactly as you would use doShift.
> 
> This kind of thing might fit better in XMonad.Hooks.ManageHelpers than
> in DynamicHooks.

Yup.  That's what I was actually saying.  doShiftScreen should go in
ManageHelpers, but the toggling of hooks is closer to the type of stuff
DynamicHooks does, so should go there.

Thanks for the feedback.

Cheers,
Norbert



More information about the xmonad mailing list