Managing an external display on Linux shouldn’t be this hard
changelog.complete.org
changelog.complete.org
The key things I needed to find out:
1. figuring out how to run a script when a display was connected or disconnected. This needed to be in a udev .rules file somewhere
ACTION=="change", SUBSYSTEM=="drm", ENV{HOTPLUG}=="1", RUN+="/usr/local/bin/monitor-hotplug.sh"
2. how to enumerate all possible video display names:
DEVICES=$(find /sys/class/drm/*/status)
3. Writing the rest of the script.
The last step is mostly left as an exercise for the reader. There are some good examples online; I'll put my current version here https://pastebin.com/V5yGgCbh for a couple of weeks.Been a while but I had real issues using udev rules as they created timing problems or something like that.
Why can't linux do this? I'm assuming displays have detectable ids of some sort?
Yes, the EDID information uniquely identifies a screen. https://en.m.wikipedia.org/wiki/Extended_Display_Identificat...
> Why can't linux do this?
It does for me (fedora, gnome, wayland). Other stacks are more work. I was put off using Sway as my desktop, because screen resolutions and layouts was manual.
Very much a corner case, but also another perfectly good monitor kept out of a landfill.
There are also EDID cloner/emulator hardware solutions that you plug in inline on the display cable.
But ... I sometimes use 1, 2 or 3 of the displays, and the configuration needs to be different depending on the number and specific displays in use.
My Linux machine can do this automatically, because this is scripted. Maybe you can do this on macOS also, but I doubt it can be done with nothing but the GUI tools.
I also have far less complications as a result. My desktop hasn't changed in close to 10 years.
We Linux users keep endlessly personalizing our systems, forking off into the sunset with ever more weird and over-optimized specialisations, and then we wonder why stuff bugs and why new users have a hard time.
Look at Windows and OSX - and the numerous problems they have supporting just one system. And here we are with our 362894 million DEs and we want different initsystems and file systems and plugins and themes and god knows what, but we get so mad when this obvious mess does not work perfectly .
Maybe stop for second and marvle at the fact that this thing can boot at all, given that no 2 people in the community can agree on how that even should be done.
(To be read in a comedic tone, channeling my Lunduke here)
In part, this is why Apple can give their customers such a polished, "just works" experience. Buy all-Apple gear, and stay in their software ecosystem, and (modulo bugs) everything will work together seamlessly.
I don't like this outcome by any means. And I still think that some desktop components certainly benefit from loose coupling and well-defined interfaces, and it's possible to avoid the "polish" downsides in some cases. But doing everything that way, while still being able to put everything together in a polished way, might actually be impossible.
This is not an uncommon view. However I can’t help but be convinced it’s the main reason the year of Linux on the Desktop hasn’t happened yet.
The user really does want their computer to seem like just one “thing,” at least in the way that it comes out of the box. When we visit websites it’s understood that these pages don’t interact with each other and weren’t designed to work together.
The OS, on the other hand, is supposed to be a system per the name.
https://www.reddit.com/r/Windows11/comments/o2a0kp/there_are...
My point was that windows is the most popular OS despite it having a ridiculous amount of “native” looks. So linux not having one is not the reason for its less than ideal desktop uptake.
Besides, as bad as Windows’ UI fragmentation is, Linux’s is worse. When opening a Linux application, from Pidgin to Firefox to the control panel to Telegram, there is absolutely no guarantee of what you’ll be getting. Having 7 design languages is bad, but what’s worse is having 0.
Both work out of the box on almost any distro, just fine
Compiling everything has always been a very niche hobby limited to mostly Gentoo and similar distribution users.
What we've maybe always being diffident about is app bundles, big images of apps with all their dependencies most of which duplicates of already installed libraries.
But I guess we're moving on from that with snap, flatpack and the likes gaining traction.
You: "it has become much better with wayland and is improving fast".
Two comments above you: "wayland has been a steaming pile of crap since it still can't work in basic graphics modes 10+ years after being announced, to the fact that it has loads of quirks that vary from one environment to another."
The typical conservative mentality.
(But KDE? I don't know, I don't use it much, but it seems like at least their stuff is mostly-compatible-if-you-work-it-a-bit, unlike Gnome's full on hostility to 'cross-compatibility.')
I am not sure why you think they don't have a "share-it-back" mentality or why you would wish any project failure. They use mostly the same set of open source licenses as KDE.
As a lawyer, I hate to inform you that the entire point of licenses is to put real teeth on ideas that people are likely to renege on. LIKE HERE.
I'm not trying to "fix issues." I'm trying to point out that, sure, Gnome may be technically following the rules, but the entire project is being a collective jerk about it.
Now, we can go deeper on why -- I have no reason to believe individual developers are jerks. I understand there there's money and influence and (cargo-culting) pressure from large companies involved.
But presently - Gnome is a collective putting out a product that is harmful to the environment -- not in an ecological way, but one that reinforces bad ideas about how to make software, aka "only do the bare minimum to comply with the license, otherwise try to dominate via whatever means possible."
Edit: In my experience, pointing out how someone is a jerk doesn't really help in open source either. That usually just causes them to become defensive and only increases the hostility. Since the code is open it's much better to just fix it for yourself and not worry about what someone else thinks. That is, if you think the situation is truly unrecoverable. If not, then it's better to set aside your differences and work it out.
They were "We have a good thing with this Unix deal and how we do it, we share freely, backwards AND FORWARD. How might we continue this in a wider fashion; knowing that some might be inclined to take and not give back?"
And thus, the GPL was born. MIT-style licenses are fine in some cases, but you're working of the back of Linux, and that's GPL territory.
"Some have proposed alternatives to the GPL that require modified versions to go through the original author. As long as the original author keeps up with the need for maintenance, this may work well in practice, but if the author stops (more or less) to do something else or does not attend to all the users' needs, this scheme falls down. Aside from the practical problems, this scheme does not allow users to help each other."
It's pretty explicitly spelled out here that it is absolutely what they meant, it wouldn't work at all if it wasn't "here's some code, do what you want with it."
If someone is trying to get you to take a case along the lines, I would have to say don't take it, it's probably not going to be a winner.
Don't feel discouraged if your first contributions didn't make it in, GNOME is a big project so I'm sure you could find some other areas to contribute to if you really wanted. Keep in mind that core areas such as the shell and GTK are probably bad places for first time contributors as they tend to be very complex, it's best to start with a smaller app/library and go from there. Of course if you don't want to contribute then you don't have to either, but I think all of this applies to most large open source projects that I have seen.
You're painting this out to be a personal issue, which it isn't. The culture among GNOME developers is one of the most toxic I've ever seen, and it's continuing to poison a desktop environment I desperately want to love. Every time I suggest something I get shut down though, so why bother? Why would I willingly hurt myself in the process of trying to make a usable desktop? The only thing I can do now is share my experience as a warning to other developers who want to make Linux-native experiences: GNOME does not want your help, don't waste your time trying.
On those individual things, you can certainly make apps outside flatpak although on a technical level I think that flatpak (or a similar packaging mechanism) is going to be the best option for a great number of apps, and I would expect that to become the focus for many app developers just because it's a lot easier and saves time. I think that comment about Adwaita is pretty inflammatory and may be seen as being against the code of conduct, not sure, but it certainly isn't my view and I doubt it is the view of the majority of contributors.
"neglecting basic functionality like thumbnails in the filepicker for almost two decades, even with literally hundreds of pull requests with suggested fixes."
I mentioned this elsewhere but I'm very disappointed to see this issue get continuously brought up, I don't think there is much we can say that is productive at this point. I've never seen a pull request from this that was actually finished to completion. Is there someone in particular you're waiting for to approve this? If so, can you think of something that could help them out? Or do you think they don't want help at all? Because from my perspective, that is not the case.
Edit: Also, hundreds of pull requests to implement thumbnails? Is that an exaggeration? I'd like to see a list of all of those if possible.
Keep in mind, it's not unusual for a large patch to go through many revisions before finally making it in. Take a look at the Linux kernel for another example, you don't have to look far to see many patches that take a long time to go through review or just never make it in because of various reasons. I don't think you are being fair by painting this as a GNOME behavior, it is simply reality on large projects with a lot of complexity and moving parts. It sounds like you are also saying systemd suffers from the same issues (it probably does) but unfortunately it seems that is another area where it's a complex problem space, so that's the trade-off that you make.
Don't worry about my project, I'm only commenting here to help you and to explain that those other opinions are not shared by everyone. In fact commenting on social media is usually a waste for my projects as it only seems to attract more negative/toxic comments from people who (incorrectly) assume that I share all my opinions with an upstream project or something like that.
That is a misconception that I've noticed, maybe it's because KDE uses different APIs for a lot of things, or maybe it's because of the way some distributions package it. But none of the Linux desktops are really that tightly coupled when you actually dig into it. For example managing the desktop settings is handled by its own daemon appropriately called "gnome-settings-daemon" that loads all its settings modules via a plugin system. KDE is structured similarly in that its code is split across a great number of small support libraries. If there is no secondary consumer of those APIs it's probably because nobody has bothered yet to make and test additional combinations of packages that actually work.
Now I'm back on Pop but this time I know enough to not customize too hard and it works great. A DE/WM is meant to function as one cohesive piece even if its built out of many components, so if you take a functional DE and start poking around then of course it will break. Even the amount of customization I can do easily without breaking anything is far above what Mac/Windows offer.
This is always my issue with Linux. Windows is boring and ugly - to the extent that I probably can't fix it - so I don't bother and I just get stuff done instead. But with Linux, I can imagine this perfectly configured workstation and I know it's possible because I've seen the things people do. So I spend hours tinkering until I break everything or get bored. Then I come back months later and the Nvidia kernel module fails to build after a kernel update or something and I have to start over from scratch. Not a recipe for productivity.
This isn't a problem with Linux, per se, more of a personal failing. I think I've almost got it out of my system.
The difference is that when setting up a new environment it costs nothing. If I had tons of tweaks and custom scripts that would be a setup cost every time.
Now I just change wallpaper and mouse cursor theme, check enabled services and remove the packages I consider unnecessary. Including the fresh installation time, it is less than 1 hour effort.
macOS is totalitarian as UNIX is libertarian if I may have some fun with analogies. No top down direction but individualism is encouraged. There is something to be said about that! It’s a test bench for super cool ideas - e.g. suckless tools.
IMHO wayland has been a steaming pile of crap since it still can't work in basic graphics modes 10+ years after being announced, to the fact that it has loads of quirks that vary from one environment to another.
That said, intel graphics tend to work for me, but pretty much nothing else consistently in linux.
Sincerely, sad user running X11 on recent laptop with hybrid graphics...
But what is apparent is that a significant portion of users, be they nivida users (and no the proprietary driver fedora wraps isn't better in this case, it just has different problems), users with the latest bleeding edge intel/amd hardware or users with slightly older hardware that wasn't part of the amdgpu test matrix, are being left to fend for themselves with X11. Ignoring that of course gnome is really the only thing that supported wayland until kwin started adding support. All the lightweight or non mainstream WM's are just running on X shims.
So, almost 20 years later, https://www.jwz.org/doc/cadt.html, (PS: don't click that directly from HN).
X11 is abandonware and shouldn't be used. Red Hat has one guy keeping the lights on.
This is IMHO the firefox/etc problems all over, instead of fixing user visible problems, while their market share plummeted they were creating an entirely new programming language to rewrite the browser in (something their competitors apparently didn't need to do). Result, eventually they can't afford to do either option because they ignored the fact that exactly 0% of their users cared about whether the browser was written in rust, or some limited subset of C++ that could be maintained.
Also, if one looks at the graphics drivers in linux, there are dozens and dozens of them that aren't amdgpu, intel, or nvidia. How many of those actually work with wayland? I'm fairly certain it isn't many.
PS: Also, if someone tries to participate, but is ignored, who is at fault? Much of the opensource community works by working to find near 100% consensus. Thats why it takes forever sometimes to get a solution. Yet, when nvidia does stick their toes into it, their contributions are ignored because "we know better", despite their market share? Doesn't sound like concensus, sounds like they got run over.
X11, being 37 years old has fundamental limitations in it's design that make it unsuitable for modern computing. There has been better ideas in the decades that followed that are incompatible with the X11 way of doing things.
This is a discussion that has happened years ago, all that's needed is to perfect the implementation so that everyone can move onto it.
The reason X works better with nvidia proprietary drivers is because you were using a hybrid proprietary X server in the first place.
My laptop is pretty much always in "Nvidia graphics" mode to power the external monitor. When I tried to install Stump I didn't have it hooked up. My laptop screen was completely blank, but everything was functional. To make a long story short, it was completely unrelated to Stump. My Nvidia output was prioritized and the internal screen wasn't activated.
I ended up learning a lot about udev, how to write udev rules (that ended up useful when trying to do something with a keyboard with a unicode symbol in its name that a program didn't like), and how to use xrandr. All in all, it was super satisfying to figure out, and I would say the frustration was worth it for me.
I know exactly zero other people in my life that would say the same thing, but I also know zero other people that would try to install StumpWM.
- logind because you probably still want lid/sleep events to work when at a VT
- gdm because you probably still want lid/sleep events to work while nobody is logged in
- desktop settings because different users may want different things to happen on those events
I'm a little confused as to why the gdm settings were needed, at least for me those only take effect when the greeter is actually open. And in GNOME the separate screensaver daemon has been removed, in part because it simplifies the whole equation.
But it seems to me that each of these things aren't entirely aware of the other, and constantly fight for control. I know logind has an "inhibit" API that lets another program take over some functions, but who knows if everyone uses it properly. And does GDM have the same thing? Or is it expected to just know when it should step aside?
Edit: The other part is the device handling logic in logind: https://www.freedesktop.org/software/systemd/man/org.freedes...
Older tools which may use suid helpers to open these devices will probably stomp all over the logind handling.
When I plug a monitor in, I expect the other ones I'm looking at to simply stay on. This doesn't seem like a huge development effort, but what do I know?
Ended up making an awk script that can be run by hand to create the xrandr command line based on the current configuration (to be applied when it fucks up). Not at my computer now but if anyone is interested in it, I can link to it.
On Linux I could just edit my xconf and everything was fine.
Installing Xmonad though introduced all of them. And my active conclusion is that there's simply a hundred corner cases and it takes time and effort to beat a specific configuration of window manager, graphics subsystem, and system status monitoring into submission. Change a major piece and break the accreted fixes.
Installing Xmonad was worth it, but lot of configuration was needed and the end result still isn't as reliable as what I left behind.
Meanwhile, ubuntu 18 + Mate - everything works fine.
I find the lack of advertising and nagging more than compensates for manually entering an xrandr command or setting a sleep mode.
If that's a problem you don't have though, it's not something you need to worry about.
sudo pm-suspend
Having to type that before I put my laptop in a bag is worth not having to worry that the laptop will spin up in the bag and cook itself trying to update the OS.At least you haven't gotten to the part where you can effectively(not literally) send hotplug events and such over displayport if you have two computers connected to one monitor. Kscreen gets a bit obnoxious in that situation. It wouldn't be too hard to send data between computers with that...
Yeah, that doesn't sound simple anymore. I'm not sure I've seen anything do that second bit.
Prior to that it was a nightmare, and I'm sure it's become a disaster all over again with Wayland.
That's where I stopped reading. Mac and Windows also have problems with such setups. Not to mention having displays with different resolutions and refresh rates
Been using that setup for almost 2 years, zero issues whatsoever, so I have no idea what you are talking about. I would be willing to concede that I just got lucky with the stability of my setup, but my friends who use similar multi-monitor setups with thunderbolt docks have no such issues either.
Lol no.
I have issues on my Windows laptop when I try to use 2x 4k + one 2k display display from the single thunderbolt connector, due to Dell TB19 dock allocating too much bandwidth for the DP and HDMI ports (while 2 of my screens are USB-C) regardless of the resolution they use or the number of screens connected.
But with just 2x 4k USB-C screen, it provides both power and display output over a single cable, both in Windows 10 and 11.
And if I connect the 3rd screen to the dock after connecting that single cable, everything works.
FYI, since it is a dock bug, the same thing happens in Linux.
> Not to mention having displays with different resolutions and refresh rates
Lol no!!!
My displays are different: the 3rd one connected by DP is an ultra wide CHG49 - so neither the same frequency, aspect ratio or DPI.
Yet it still all works fine. Linux users are weird when they start assuming just because I use Windows, I must have an experience as bad as theirs.
Even my terminal (mintty) is far better than the best Linux has to offer - and I'm not even talking about AHK that lets me control my keys in a language far more advanced what the few configuration xkb or xmodmap offer.
Also, what about audio that likes to update in the background and can simply fail until I reboot?
The thing is, OSs are goddamn complex and thus they have plenty of bugs all around.
I have noticed a little flickering on my Lumia 950 that runs Windows 10, but I'm ready to give a pass to 5 years old hardware running an experimental build of ARM64 Windows.
Maybe we have different hardware? I'm mostly using Lenovo laptops with one Microsoft and one Dells tablet.
> Also, what about audio that likes to update in the background and can simply fail until I reboot?
You mean driver updates? It depends on your Windows Update settings.
If you mean the audio getting rerouted, I like that when I plug a new device it gets the audio sink priority without fiddling.
And I like I can control that behavior with AutoHotKey scripts to do precisely what I want if I need to.
> The thing is, OSs are goddamn complex and thus they have plenty of bugs all around.
That is an absolutely fair comment! I'm just surprised linux geeks especially in a specific age group (over 25) seem to believe Windows is evil and anyone using it must not be a techie / must have a horrible experience and would find immediate enlightenment and satisfaction if installing Ubuntu.
All kind of nuance seems to be lost when you explain that it works fine for you, and give practical examples of advanced things that would be extremely complicated and sometimes totally impossible to do in Linux
This wasn't an issue with older models that had some other means to connect a monitor other than thunderbolt but these newer models only had thunderbolt display and it didn't work properly.
I believe Caldigit (The one Jeff Geerling uses) is the good one.
Sorry, but this is just not correct. I have used multiple monitors with varying resolutions and refresh rates with a Mac for well over twenty years.
I can see that. I had 2 27" 4K HDR 144Hz monitors that worked fine in Catalina. Big Sur and Monterey, they do not: they'll do 95Hz SDR and 60Hz HDR.
If on my screens I change DisplayPort mode from 1.4 to 1.2, they'll do better (120Hz SDR). So something in Big Sur broke DP 1.4. And Apple doesn't care, because there have been hundreds of bug reports on it ever since the Big Sur betas and it's still broken as of Monterey 12.0.1.
I guess Apple's philosophy is "we don't care if you don't have a Pro Display XDR" (and I say that as someone who owns one).
https://discussions.apple.com/thread/252174979?page=1
https://egpu.io/forums/mac-setup/4k144hz-no-longer-available...
I have to use SwitchResX to define a custom resolution (95Hz), otherwise my gaming monitor won't go above a sad 60Hz.
Meanwhile, Linux runs perfectly on the same setup all the way up to 160Hz. Yet another place where Linux has fundamentally better hardware support than Mac.
Even Catalina wouldn't support my displays at 160Hz, only 144Hz.
Not at all. Windows just works.
It's great that some of you, most people even, don't have these problems with multiple screens on your preferred OS. However, that doesn't mean that no one does.
Think about it. If everyone had these problems, they would have been fixed. Things are not black and white. Not every setup is the same.