How to have separate layout sets per screen in XMonad?

Hi all! Is it possible to define 2 separate layout sets one per monitor in use? (not one per workspace) The use case is basically to have layouts with a master area on the left side for my right monitor, and the same layouts only 'reflected horizontally' (using Layout.Reflect) on my left monitor (i.e. master area on the right), so that, overall, the master areas are always in the center of the total estate of the 2 monitors. A solution that has separate layout sets per screen should be more than enough for this. I have a vague memory of finding such a module way back when, but I've went through the entirety of xmonad-contrib recently (looked at xmonad-extras as well) and didn't find a solution for this. There are separate layouts per workspace, and having separate workspaces per screen, but I want to switch between the 2 monitors on the fly and have consistent layouts as described above. So this solution won't work. In case I'm not missing any module in contrib, could someone please point me in a good starting direction as to how to implement such a thing? Any help is greatly appreciated!

On Wed, Dec 2, 2015 at 3:11 AM, Tal Walter
In case I'm not missing any module in contrib, could someone please point me in a good starting direction as to how to implement such a thing?
This could be done with a layout modifier similar to onWorkspace, but you'll need to look in the StackSet for the workspace tag being laid out and determine what ScreenID it is currently on: that information is not passed to the LayoutHook. (xmonad-contrib in git has PerScreen but that triggers by screen width, not screen ID.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Thanks Brandon!
Using the PerScreen module, I simply switched the condition from being on
the screen width, to being on the screen x coordinate (which obviously
differs between the left and right screens).
However each time a new layout is returned (i.e. each time I switch
screens) the index of the current selected layout from the layouts in the
set is being reset.
That is to be expected because there is no way of knowing apriori that the
2 layouts will have an equal amount of items, but in my case the 2 layout
sets are symmetrical, therefore I would like to stay consistent with
current selected layout index in the layout set. I tried looking around the
Workspace ADT and the runLayout func but can't find a way to get to such an
index.
Is it feasible in a simple manner?
I attached the code that I currently use.
Any help is yet again, greatly appreciated!
Thanks!
On Wed, Dec 2, 2015 at 3:44 PM, Brandon Allbery
On Wed, Dec 2, 2015 at 3:11 AM, Tal Walter
wrote: In case I'm not missing any module in contrib, could someone please point me in a good starting direction as to how to implement such a thing?
This could be done with a layout modifier similar to onWorkspace, but you'll need to look in the StackSet for the workspace tag being laid out and determine what ScreenID it is currently on: that information is not passed to the LayoutHook. (xmonad-contrib in git has PerScreen but that triggers by screen width, not screen ID.)
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Thu, Dec 3, 2015 at 4:25 AM, Tal Walter
Is it feasible in a simple manner? I attached the code that I currently use.
There is no such index. The layout is a function, it doesn't keep an index. This is also why there is no PreviousLayout message matching NextLayout. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

I see.
Thanks anyway! The partial solution is great as well!
On Fri, Dec 4, 2015 at 6:13 AM, Brandon Allbery
On Thu, Dec 3, 2015 at 4:25 AM, Tal Walter
wrote: Is it feasible in a simple manner? I attached the code that I currently use.
There is no such index. The layout is a function, it doesn't keep an index. This is also why there is no PreviousLayout message matching NextLayout.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (2)
-
Brandon Allbery
-
Tal Walter