
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? Cheers, Norbert -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments

On Mon, Dec 19, 2011 at 12:41 PM, Norbert Zeh
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. -- Adam

adam vogt [2011.12.20 1447 -0500]:
On Mon, Dec 19, 2011 at 12:41 PM, Norbert Zeh
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

On Tue, Dec 20, 2011 at 14:47, adam vogt
On Mon, Dec 19, 2011 at 12:41 PM, Norbert Zeh
wrote: - Display a certain type of window (say emacs) on a certain screen (screen, not workspace)
You can't really address screens that way; a screen holds a workspace, and workspaces are addressable. You can determine the workspace currently on a screen, though, and use that. Alternately you could use IndependentScreens which effectively gives each screen its own set of workspaces, which change in concert across all screens.
- 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
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.
You *can* have conditional ManageHooks, using ExtensibleState. I suspect it's easier to use something in the same vein as FloatNext, though (but that would mean remembering to activate it before creating each window). I am tempted to say this is the wrong solution, though. Looking at it from a higher level, I think what you really want is IndependentScreens + TopicSpaces; you would then be able to arrange that, in a given topicspace, emacs always opens on a particular screen. (I don't know how well those two compose, though.) -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On Tue, Dec 20, 2011 at 20:11:14 GMT, Brandon Allbery wrote:
You *can* have conditional ManageHooks, using ExtensibleState. I suspect it's easier to use something in the same vein as FloatNext, though (but that would mean remembering to activate it before creating each window).
I added code which generalizes FloatNext into X.H.ToggleHook. It adds support for strings in the dynamicLog, updating the dynamic log, bindings and such. Because they are boolean, dealing with them when they interact can be tedious (e.g., moving focus back to the current window whether it shows up under or over the current window). -- Ben
participants (4)
-
adam vogt
-
Ben Boeckel
-
Brandon Allbery
-
Norbert Zeh