Skip to main content

Ralsina.Me — Roberto Alsina's website

XRandRoll: a new program to configure displays

TL; DR: I wrote a ex­per­i­men­tal tool to sup­port X dis­play con­fig­u­ra­tions which I think is, or at least will be, bet­ter than oth­er­s, and you can check it out at http­s://github.­com/ralsi­na/xran­droll

Now the re­al post:

I have been us­ing a du­al mon­i­tor con­fig­u­ra­tion for a lit­tle while. How­ev­er it's a slight­ly spe­cial one.

  • One mon­i­­tor is a nor­­mal sam­­sung 27" 1080P mon­i­­tor. But it's in a mon­i­­tor stand that al­lows it to ro­­tate. So it's ei­ther hor­i­­zon­­tal or ver­ti­­cal.

  • The oth­­er mon­i­­tor is the lap­­top's. BUT ... it's a 2-in-1 so it can be in "nor­­mal" or "ten­t" or "tablet" po­si­­tion­s. And when it changes po­si­­tion it re­­con­­fig­ures it­­self au­­to­­mat­i­­cal­­ly us­ing KDE's awe­­some sup­­port for it. So it can be in 4 dif­fer­­ent ori­en­­ta­­tion­s.

So, if you are count­ing, that gives me 8 dif­fer­ent pos­si­ble mon­i­tor con­fig­u­ra­tions.

Al­so, an­oth­er thing is that while both screens have the same res­o­lu­tion, they have very dif­fer­ent phys­i­cal di­men­sion­s. Dis­play con­fig­u­ra­tion tools usu­al­ly don't care for that (maybe with good rea­son!)

So, I want­ed to ex­per­i­ment with how a tool would work that:

  • Looked / worked more or less like cur­rent tools

  • Al­lowed a lit­­tle more flex­i­­bil­i­­ty

  • Did some fan­­cy scale things with phys­i­­cal di­­men­­sions

  • Tried to sup­­port xran­­dr fea­­tures that are ig­nored by most tools

  • Got its con­­fig­u­ra­­tion from xran­­dr it­­self.

  • Ap­­plied its con­­fig­u­ra­­tion via xran­­dr

  • Did screen mir­ror­ing bet­ter (say: ex­act mir­ror­ing when mon­i­­tors are not the same mod­­e? It does that)

So, xran­droll starts with sev­er­al "philo­soph­i­cal" opin­ions in place.

In prin­ci­ple, it stores no con­fig­u­ra­tion. It should ob­tain the state from xran­dr. So it starts with a re­al re­flec­tion of your sys­tem as it ex­ist­s.

It al­lows more dis­play scal­ing flex­i­bil­i­ty. In­de­pen­dent scales per ax­is! A wid­get that does all the sil­ly cal­cu­la­tions to make things the same size!

It sort of does what I want now? In a pro­to­type­y-this-­code-need­s-­to-be-rewrit­ten way?

For the fu­ture, I in­tend to add ca­pa­bil­i­ty to mon­i­tor your mon­i­tors (he­h) and re­fresh it­self if, for ex­am­ple, you plug in a mon­i­tor to your com­put­er with xran­droll run­ning. Al­so, some sort of ser­vice that con­fig­ures mon­i­tors au­to­mat­i­cal­ly as they are added / re­moved.

So, it may be worth tak­ing a look at it. If you find bugs (there are bound to be dozen­s) you can file a bug at­tach­ing your xran­dr out­put and I can de­bug them!

In­ter­ac­tion, UX, etc are still a WIP and sub­ject to change. Ex­per­i­ments are be­ing made. But it should be un­able to de­stroy your sys­tem! You can prob­a­bly even go back to what­ev­er work­ing con­fig you had by click­ing "Re­set"!

Have fun and keep me post­ed.


Contents © 2000-2024 Roberto Alsina