this post was submitted on 29 Apr 2024
474 points (96.1% liked)

linuxmemes

21428 readers
1218 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack members of the community for any reason.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn. Even if you watch it on a Linux machine.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, and wants to interject for a moment. You can stop now.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't fork-bomb your computer.

    founded 1 year ago
    MODERATORS
     

    If anyone wants to give an ELI5 or a link to a video that ELI5 I'd be incredibly thankful

    I swear that all the stuff I find is like super in depth technical stuff that just loses me in no time flat

    you are viewing a single comment's thread
    view the rest of the comments
    [–] savvywolf@pawb.social 208 points 7 months ago (7 children)

    Programs running graphically (Firefox, your file browser, etc.) need a way to tell the system "draw these pixels here". That's what the display server does; it takes all these applications, works out where their windows are and manages that pixel data.

    XOrg has historically been the display server in common use, but it's very old and very cobbled together. It generally struggles with "modern" things that must people expect today. Multimonitor setups, vsync, hdr and all that. They work, but support is hacked together and brittle.

    Wayland is a replacement for XOrg that was designed from scratch to fix a lot of these issues. But it's been an uphill battle because XOrg is the final boss of legacy codebases.

    tl;dr They're both software that manages drawing pixels from applications to the display.

    [–] Ensign_Crab@lemmy.world 69 points 7 months ago

    XOrg is the final boss of legacy codebases.

    Pretty sure the IRS still holds that title.

    [–] Gormadt@lemmy.blahaj.zone 50 points 7 months ago (1 children)

    The TLDR was really helpful NGL

    So it's software that handles software wanting to display things on the screen. Because having each piece of software do it itself would be not only chaos but a massive security concern. And it's a big deal because it fixes (by replacing) the old software with something that's easier to work with than the old ways of doing things (due to all new code that's not spaghetti that's hacked together over decades).

    Am I close?

    [–] loutr@sh.itjust.works 37 points 7 months ago (2 children)

    Because having each piece of software do it itself would be not only chaos but a massive security concern.

    Not really, the main point is that (most) apps don't know where they are on the screen, whether they're minimized, on the active workspace, ... and they don't care either. That's the responsibility of the window manager.

    The app tells the display server "I need a window to display these pixels" and that's it. And the window manager, well, manages these windows.

    On the topic of security, X11 doesn't handle security at all, that's one of the main issues. So any graphical app can read the other windows' pixels, grab everything you type, everything you copy, ... OTOH Wayland isolates apps so they can't do that by default. Apps that really need to (screenshot apps, ...) can use "portals" to ask for these permissions.

    [–] Gormadt@lemmy.blahaj.zone 16 points 7 months ago (1 children)

    That's really interesting and thank you

    I think I'm beginning to get it now, and Wayland does sound better than X11 at least

    [–] bisby@lemmy.world 22 points 7 months ago

    I use wayland, but be warned that there are downsides.

    X11 is 40 years old. Which means that even though it has 40 years of bad decisions baked into it, it also has 40 years of features and tooling built around it.

    And in some cases, things are purposefully broken in the name of security as mentioned above. Writing a keylogger on X11? Easy. Every app can watch the keyboard even when they aren't in focus. So if I type my password into firefox, Discord can listen. Hope you don't have any malicious apps just patiently listening to all your keystrokes.

    Getting rid of input listening sounds great! .... Except for the concept of global keybinds. Have a Push to talk button in discord that you need it to be able to listen to while youre playing a game? Sorry, the game is in focus, so discord can't see ANY of your input. Including the push to talk button. Different wayland servers have different ways of handling this with their portals. Some don't have it at all. And the ones that do don't always have great solutions.

    One major issue that has been in wayland debate hell... how do multi-window apps communicate with each other. For example GIMP. The editor window is a separate window from the toolkit which is a separate from the layer view. GIMP on X11 knows where all of its windows are because it can see everything. if you wanted GIMP to save all the window positions, it could. GIMP on Wayland has no idea where each window is relative to each other. Each window knows its own size and shape. And thats it. It doesnt know where on the screen it is. Which means it doesnt know where it's other sub windows are relative to itself. Which means GIMP on Wayland can't really save the window positions for next run. Wayland is working on a protocol for handling this, but its been caught up in debate hell last I saw. This is a prime example of a thing X11 had. And Wayland will someday have, but the 40 year headstart and disregard for security gives X11 a huge headstart.

    Most of these problems have workarounds and solutions, but you might find yourself in a situation where you do in fact need to implement a workaround instead of having everything Just Work.

    "Better" means different things to different people. Architecture and security and technologically? Wayland is better. Just Works and its what your apps were probably built to run on so less weird edge case issues? X11 is still better just due to inertia. (And again, I use Wayland, I'm willing to deal with the workarounds, but you do you).

    [–] oo1@kbin.social 5 points 7 months ago (1 children)

    Does it also handle key and mouse inputs to make sure they're interpretted by the right programme in the right context?

    [–] loutr@sh.itjust.works 5 points 7 months ago

    Yep that's also the WM's job.

    [–] Shareni@programming.dev 7 points 7 months ago* (last edited 7 months ago) (1 children)

    But it's been an uphill battle because XOrg is the final boss of legacy codebases.

    Also because Wayland forces every compositor to be an unmodifiable monolith instead of following the UNIX philosophy. For example I'm currently running i3 inside of Xfce because the de, wm, compositor, and every other part are doing their own thing and can be replaced. With Wayland I'd need to fork the compositor and spend a ridiculous amount of time on something that's trivial in xorg.

    And let's not forget the garbage pile of tools that got abandoned a week after release because Wayland introduces breaking changes on a regular basis. You want unified shortcuts across multiple compositors like with sxhkd? Tough luck, the only tool was abandoned after the first version and doesn't work anymore. On the other side you've got 15 rofi alternatives you need to dig through to find out which ones are still maintained and might work on your device.

    On top of that Nvidia GPUs have so many issues, and while that's not solvable by Wayland, it's still a major issue that still hasn't been fixed after 15 years, but might maybe soon™.

    Finally, the security improvements have gave me nothing but headaches whenever I tried using Wayland. No matter the distro or compositor, screen sharing and recording never worked for me. Give permissions, share whole screen or just window, it's either black or the program is not showing I'm trying to share ate all.

    You can't blame it all on xorg when Wayland is still simply far worse for a large part of the community.

    [–] possiblylinux127@lemmy.zip 1 points 6 months ago (1 children)

    The Wayland protocol board can never agree on anything. It takes them years to decide to consider adding something.

    Also Wayland is just a protocol at the end of the day so implementation is up to the software developers. I also think that the Unix philosophy holds back software that could be good. You shouldn't prioritize it over good battery life and low overhead.

    [–] Shareni@programming.dev 2 points 6 months ago

    I also think that the Unix philosophy holds back software that could be good.

    IMO the UNIX philosophy is the reason why Linux survived. Imagine if every distro had a single DE, or you had issues with pulseaudio and couldn't replace it with pipewire.

    You shouldn’t prioritize it over good battery life and low overhead.

    And why would separating functionality into different tools cause you to have a worse battery life? You don't get to have tlp on other OS because it's all integrated

    [–] 1_4M_N008@programming.dev 6 points 7 months ago* (last edited 7 months ago) (1 children)

    It seems an opportunity to ask my stupid questions.

    Q1. If I am going to build my minimum linux installation without a GUI, does this require a display manager?

    Q2. is there other way to interact with my machine other than tty

    [–] macaroni1556@lemmy.ca 10 points 7 months ago* (last edited 7 months ago) (1 children)

    Q1: No, it does not require X. But some software even if not graphical, requires X libs for whatever reason (e.g. Using Qt)

    Edit: to answer Q2: I don't think there is technically a way to interact with the system without a TTY but thats technicalities. Your more practical answer is to use SSH to log in and interact. This is how most IoT things work which run Linux and have no display capability at all.

    [–] 1_4M_N008@programming.dev 1 points 7 months ago* (last edited 7 months ago) (3 children)

    thanks, but is there way to address some limitation (e.g. only one came to my mind scroll back.)

    [–] macaroni1556@lemmy.ca 4 points 7 months ago

    Use screen?

    Maybe I don't understand what you're after. But 99.9% of Linux systems don't use X. But none of those are desktop PC's.

    [–] AVincentInSpace@pawb.social 3 points 7 months ago

    https://wiki.archlinux.org/title/Fbterm can take care of some of the limitations (use TTF fonts, for example) but support in general for nongraphical environments on Linux at the moment is not amazing

    [–] redcalcium@lemmy.institute 2 points 6 months ago (1 children)
    [–] 1_4M_N008@programming.dev 1 points 6 months ago

    Thanks for the advice

    [–] LucidBoi@lemmy.dbzer0.com 4 points 7 months ago (1 children)

    How do I check which one my OS uses?

    [–] infeeeee@lemm.ee 24 points 7 months ago (2 children)

    It's not os based, usually you can switch between the 2 on your login screen. To check if you are in a wayland session, type this in a terminal:

    echo $XDG_SESSION_TYPE
    

    The answer should be wayland or x11

    [–] LucidBoi@lemmy.dbzer0.com 2 points 7 months ago (1 children)

    Huh, it's x11... Isn't Wayland also better for gaming? I would want to switch.

    [–] infeeeee@lemm.ee 7 points 7 months ago

    afaik with nvidia x11 is still recommended for gaming

    [–] DacoTaco@lemmy.world 1 points 7 months ago* (last edited 7 months ago)

    Or empty if neither (shell access), but thats obvious hehe

    [–] possiblylinux127@lemmy.zip 3 points 6 months ago

    Wayland isn't software as it is just a set of protocols. The desktops and window managers take the place of X on Wayland. That's why it has better performance.