Elv13 / tyrannical

Dynamic tagging configuration system for awesomeWM
211 stars 33 forks source link

Associating tags with screens by index is brittle #85

Open madduck opened 6 years ago

madduck commented 6 years ago

Turns out that screen.index is not stable. Using three xrandr calls, I can swap the indices of two connected screens on this machine (and I had to find this out the hard way, swapping between an external monitor and a projector).

Tags are currently associated with screens by this index. As a consequence the layout got completely inverted, and tags that I want on screen 1 now were on screen 2 and vice versa.

There does not currently seem to be a stable identifier for a screen. I am using table.concat(gears.table.keys(s.outputs), "+") in another context at the moment, but that's also a problem case for me, because at the office, the monitor on DP1 has a much higher resolution than my laptop screen, whereas at home, the monitor on DP1 is smaller, and so I choose to have the external monitor be my primary screen at the office, but not at home. Using just the output names to associate tags with screens therefore also leaves some to be desired.

Awesome does not expose the EDID, that would be ideal IMHO. But I guess there are hacks, such as storing a name field with a screen. Instead of implementing one of those, however, would you consider a patch that lets the screen property of a tyrannical_tab take a callback function which can then indicate whenever the layout changes whether a given tag should appear on a certain screen?

Or do you have a better idea?

If you like the callback approach, then I'd appreciate if you might be able to give me a starting pointer. I've stared at the code for a while now, but i honestly don't know where I'd start with this.

Thanks! -m

Elv13 commented 6 years ago

My plan is https://github.com/awesomeWM/awesome/issues/2185#issuecomment-364183841

tl;dr: Make the Awesome screens virtual and have an "hidden" layer below the screen object and above the xrandr mapping code. This would allow this hidden layer to bring some consistency to screens.

Right now there is many, many problems, not just this one.