Posts about programming

2020-02-04 13:52

XRandRoll: a new program to configure displays

TL; DR: I wrote a experimental tool to support X display configurations which I think is, or at least will be, better than others, and you can check it out at https://github.com/ralsina/xrandroll

Now the real post:

I have been using a dual monitor configuration for a little while. However it's a slightly special one.

  • One monitor is a normal samsung 27" 1080P monitor. But it's in a monitor stand that allows it to rotate. So it's either horizontal or vertical.

  • The other monitor is the laptop's. BUT ... it's a 2-in-1 so it can be in "normal" or "tent" or "tablet" positions. And when it changes position it reconfigures itself automatically using KDE's awesome support for it. So it can be in 4 different orientations.

So, if you are counting, that gives me 8 different possible monitor configurations.

Also, another thing is that while both screens have the same resolution, they have very different physical dimensions. Display configuration tools usually don't care for that (maybe with good reason!)

So, I wanted to experiment with how a tool would work that:

  • Looked / worked more or less like current tools

  • Allowed a little more flexibility

  • Did some fancy scale things with physical dimensions

  • Tried to support xrandr features that are ignored by most tools

  • Got its configuration from xrandr itself.

  • Applied its configuration via xrandr

  • Did screen mirroring better (say: exact mirroring when monitors are not the same mode? It does that)

So, xrandroll starts with several "philosophical" opinions in place.

In principle, it stores no configuration. It should obtain the state from xrandr. So it starts with a real reflection of your system as it exists.

It allows more display scaling flexibility. Independent scales per axis! A widget that does all the silly calculations to make things the same size!

It sort of does what I want now? In a prototypey-this-code-needs-to-be-rewritten way?

For the future, I intend to add capability to monitor your monitors (heh) and refresh itself if, for example, you plug in a monitor to your computer with xrandroll running. Also, some sort of service that configures monitors automatically as they are added / removed.

So, it may be worth taking a look at it. If you find bugs (there are bound to be dozens) you can file a bug attaching your xrandr output and I can debug them!

Interaction, UX, etc are still a WIP and subject to change. Experiments are being made. But it should be unable to destroy your system! You can probably even go back to whatever working config you had by clicking "Reset"!

Have fun and keep me posted.

2019-11-14 15:02

Episodio 17: Esto es Personal

A veces gente me pide consejos sobre su carrera y cosas así... probablemente no soy la persona correcta para darlos.

2019-11-03 09:40

Episode 15: Faster Python in 5 seconds!

This is a video I did in spanish, but I have added english subtitles!

It's about different ways to make your python code faster without changing your code, hope people like it, because doing the subtitles is a ton of work ;-)

2019-10-23 23:49

Episodio 14: Tests & Bananas

Una intro rapidita a unit tests.

¿Por qué? ¿Es muy difícil? ¿Vale la pena?

¿Aún si uno está haciendo un programita así nomás?

2019-10-18 18:00

Episodio 13: Python 3.8

¿Qué trae de nuevo Python 3.8? Un montón de cosas, pero hay 2 en particular que afectan / mejoran / resuelven temas que me molestan desde hace ¡Más de 10 años!

Contents © 2000-2019 Roberto Alsina