Common problem? I’ve never heard of this happening. I suppose hypothetically random applications could trash my X settings but in 20 years they haven’t.
On Windows I have observed random applications do have this power and sometimes exercise it, but the worst it’s ever done is mess up my desktop icon arrangement, by some mechanism I know not the OS reverts the resolution change if the application crashes.
But those few gravitate around OSes using X11. Any other graphical OS has way more users that use the computer they are given to perform the task they are given. No questions asked, no fiddling with settings. When you develop for people that use a system specifically because it allows fiddling, you must not take away functionality. If you do, prepare for criticisms.
And somehow, I doubt that even the most fervent of fiddlers really enjoy typing obscure command line incantations just to configure their laptop when they connect it to a projector.
What you are thinking of is an API, not a command line interface. That still exists, and it can be used to build a command line interface. Command line interfaces by themselves are actually very poor for automation and integration, as they force you to do lots of unnecessary formatting and parsing in and out of text strings at every step.
For graphical tasks such as this, the command line is indeed obsolete. The main usage for remaining with the command line in modern times is for manual administration of a remote server, but that is not relevant here as the whole problem space is about administering the local machine as a GUI.
Anyway, xrandr is already there and Google and stackoverflow are full of examples. I'm not surprised that people would invest half an hour copy pasting code from there instead of identifying and learning the underlying API. I don't see why that should be a problem.
It is not true that command-line interfaces are not used to remotely administer GUI desktops. This is actually a huge and very common problem space.
See my other comment about impedance mismatch for an explanation of the challenges with using command lines to remotely administer GUI desktops. It can be something that complements GUI administration, but can never possibly supplant it, because if you do that then you're intentionally trying to route around the problem space.
> It can be something that complements GUI administration, but can never possibly supplant it,
There are probably tens of thousands of people whose daily lived experience is that command-line administration of GUI desktops is all they've ever needed and yes, in fact, totally supplants the alternative. I am really struggling with this thread; it's my impression that you've a very narrow view of what people are doing with their computers.
This is exactly what Wayland has done though. Few have a reason to run command line tools to change the screen configuration, real world usage is to use a GUI as is common on every other graphical OS.
>You can pass resolution, refresh rate, position and orientation via command line in a simple and understandable way.
A major problem here is because of the way the API works, technically any X11 client can do that at any time. The tool may seem trivial but the way it is implemented has great potential for misuse. It does not even have to be malware for this to cause problems, for example a typo in a random script could seriously screw up your screen. Or another common problem in X11 is with applications setting the resolution to something weird, crashing and then leaving the screen in a weird state.
>This completely confirms second system syndrome. It's only as complicated and non-trivial as you want it to be. I can only imagine what kind of convoluted security nonsense you think of when you say "the right way". Ask the display server for a list of screens and supported resolutions, and then tell it what you want to do with those.
If this was second system syndrome, then it would be in the kernel, not in X or Wayland. Because the kernel is where all the new KMS features happened. Again, the display server is not actually driving this feature. They are relaying information to and from KMS, which is the actual API that configures the screen.