18 ms·
Guide: Full Wayland Setup for Linux
- whalesalad 6y agoAt the end of the day what is the benefit to the layman of being 100% pure wayland?
- colingw 6y agoThe benefit most noticeable to me is the faster user interface.
- sprash 6y agoIn my experince X11 is faster (as in latency) when run without any compositor.
- silon42 6y agoThis seems critical. Could be fixed by turning off vsync?
- sprash 6y agoNot entirely. Despite the fact that no available Wayland compositor allows you to disable vsync at this point Wayland also throws away all the work done by ddx drivers on X11 implementing 2D acceleration. This allows X11 clients to de-facto render to directly to the frontbuffer when no compositor is in use. It is the lowest possible latency you can get.
- cycloptic 6y agoIn theory there could be a Wayland implementation that loads Xfree86 drivers, but why? Going forward, the implementations that want high performance and low latency (i.e. VR/XR interfaces) are likely going to target Vulkan, and you will likely never want to disable vsync there.
- bitwize 6y agoDDX is deprecated in favor of GLAMOR for acceleration. Which roughly matches the story on Wayland: use OpenGL on the GPU for acceleration. Then again, Xorg is effectively deprecated in favor of Wayland...
- husam212 6y agoI noticed some weird bugs with clipboard sharing, a pure wayland setup avoids such quirks.
- dtx1 6y ago* Security Benefits, maybe! * No more screen tearing * Multiple Displays with multiple different refresh rates, on some compositors (sway can do it!) * HWVideo Acceleration for firefox (on some setups) * it can be faster in some situations * In the future: More likely support for HDR, VRR etc.
- gspr 6y agoNice bonus I didn't expect when moving to Wayland: my touchpad magically started behaving waaaay more nicely.
- babypuncher 6y ago> Multiple Displays with multiple different refresh rates, on some compositors (sway can do it!) Does this mean we can get VRR on our primary display without having to completely disable other monitors when playing games?
- nitsky 6y agoWayland fixes a number of long standing issues with X, including: * No screen tearing. * Better hidpi support including different scale factors on different monitors. * Improved security, because clients do not have access to all state on the server and servers do not run as root. Separately, I like how with Wayland the compositor is also the server, so from a TTY you can enter a desktop environment by running a single executable with a single configuration file.
- jude- 6y agoWhat happens to your graphical programs when your compositor crashes? At least with X11, if your window manager crashes, your programs keep running (you'd just fire up the WM again).
- colingw 6y agoSway (the window manager) _is_ the compositor. There is no need for a separate program like compiz or picom.
- sprash 6y agoWhich is a mistake. On X11 the server, window manager and compositor are three separate programs. Both window manager and compositor can individually crash, started, stopped and replaced at runtime without any of the other running X11 client instances affected.
- ubercow13 6y agoOn the other hand on X11, Xorg cannot crash without the X11 client instances being affected - a much larger chunk of code. It's only because Xorg is older that that doesn't happen much.
- sprash 6y agoA chunk of code that is running in production for more than 30 years and should be considered battle tested. In my experience Wayland compositors crash much more often than X11 despite the supposed reduced complexity. The last time X11 server crashed on me was in 2004 if I remember correctly.
- levesque 6y agoOne huge drawback for me is no support for proprietary NVidia drivers.
- Rovanion 6y agoNews just came out they will support it in the next release.
- TobyBrull 6y agoCare to share a link? I could only find this: https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-DMA-BUF-Wayland-KDE https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-D... ? That's already a couple month's old, though.
- wmf 6y agohttps://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-470-Wayland-Friendly https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-4...
- justaguy88 6y agoThats not wayland though, that the choice of the implementation.
- hawski 6y agoTo a layman none or almost none direct benefits. But there are non-direct benefits like those listed by sibling comments. However it will, in longer term, simplify work for developers, while in short term it will be or rather it is a complication in the transitional phase. It is an evolutionary step for end users, there is no revolution really. What is the benefit to a layman of a program to change bogies in all trains? He doesn't care about regenerative breaking, so smoother ride? But until almost all of his rides are on this newer platform he would not see a real benefit. Then when it is finally there he will only see its absence. Same with Wayland.
- MayeulC 6y agoI really like no application being in control of other windows besides my compositor. As a side-effect to security improvements (clipboard, keylogger, screnshotter), you get: - Apps cannot arbitrarily modeset (change screen resolution and "mess my desktop up") anymore. - Under sway, apps are the size I want. I can somewhat resize them over/under their limits - No more windows that grab the focus and force their way to the foreground - Apps cannot move my mouse cursor anymore. I hate it when they do, I know some Cadence DKs that do so (position the mouse cursor on the OK button: nice touch, I hate it). - Some apps/games might have crashed when changing workspaces, but I have never once been unable to "alt-tab" or change workspace, change the screen the app was on, etc. Granted, under sway those are just different APIs and are not hardened, but they could be in the future. And I mean the above, I've had to restart the X server (or switch to a TTY and kill the app) due to a misbehaving app numerous times, but this is mostly a thing of the past now. Also, bonus: - easy multiseat under sway: in under 1 minute, given an extra mouse/keyboard, I can theoretically work with someone else on the same computer: I have a window focused, that I can type in, they too. - Easily create headless displays, or nested sessions (sway can run as a wayland, X or DRI client). You can use that to leverage another computer as an external display: https://news.ycombinator.com/item?id=25891464 https://news.ycombinator.com/item?id=25891464 - Under sway, the compositor handles configuring input and display. No more xorg.conf (cue https://xkcd.com/963/ https://xkcd.com/963/ though it's less true these days). And on the technical side: - From my understanding, apps should be able to pass GPU buffers around much more efficiently, even drawing directly on the final buffer thanks to dma-buf. This leads to lower-latency and higher performance, especially for high resolutions. In turn, it helps quite a bit with pipewire for screensharing and passing video around, as well as zero-copy hardware video acceleration.
- ciupicri 6y ago> Sway is a tiling window manager [...] written in C, and thus is very fast and has little resource overhead. So is GNOME as far as I know.
- xfalcox 6y agoGnome is not a tiling window manager.
- londons_explore 6y agoIsn't gnome a big pile of JavaScript these days anyway?
- hc-taway 6y agoYes, as is Pop Shell implemented on top of Gnome (mentioned in another comment). You can tell they've made some questionable decisions when you try to use Gnome on very weak hardware. On an old dual-core Celeron w/ 2GB memory I found it unusable. KDE—which, when I first started using Linux desktops on machines less than 1/4 that powerful, was noticeably heavier than Gnome—was a little slow but basically fine. To my eyes gnome also drops frames like crazy (like, even for Linux, which is a pretty jittery environment to begin with) even on excellent hardware—not sure, but I think it's a reasonable guess that's also a symptom of sprinkling a scripting language all over the system without incredible levels of discipline to make sure it's never in the way of anything important. Webtech strikes again.
- emptysongglass 6y agoBut it can be with a touch of Pop Shell! It comes out of the box in Pop!_OS, which is Ubuntu plus GNOME plus extra features.
- vcxy 6y agoI never use GNOME but I decided to try it to test pop shell awhile back. This was shortly before 1.0 of pop shell so it could have changed. Not trying to disparage it, just sharing my experience as an i3 user. It feels so so slow because of animations. I googled how to get rid of animations because it wasn't in the GUI settings. Animations were removed, but a delay remained with any tiling movements where an animation would have been. Not sure if this is a limitation of GNOME or a bug in pop shell, but it wasn't going to work for me. It would be really hard to give up the snappiness.
- xfalcox 6y agoI went full wayland a few months ago, at first on Ubuntu. Now, I'm using the early days of the Manjaro Sway Community edition, and it's basically everything that is described in this post packaged and pre-configured out of the box. https://github.com/Manjaro-Sway/manjaro-sway/ https://github.com/Manjaro-Sway/manjaro-sway/
- vz8 6y agoI suppose trying this on VirtualBox (Win10 system) could be an exercise in frustration, but I'm tempted...
- dtx1 6y agolive boot from a usb stick might be better.
- clircle 6y agoI have Ubuntu 20 and sometimes switch between "Ubuntu" and "Ubuntu on Wayland" and can't tell any speed difference.
- mappu 6y agoThis is an opinionated guide, hopefully nobody gets the wrong idea like it's actually hard to start using Wayland - for me, switching to Wayland was one drop-down menu option that automatically appeared on my login screen.
- MuffinFlavored 6y ago> switching to Wayland was one drop-down menu option that automatically appeared on my login screen. On what distro?
- OtomotO 6y agoI assumed they meant they used gnome 3+ or kde plasma (or another de) where it's just another option on the login screen. For i3 -> sway it's not as easy but also not very complicated, nor time-consuming
- MuffinFlavored 6y agowhen you install GNOME 3 these days, does it install both Xorg + Wayland packages, and then at runtime you pick which you want? I would have guessed the GDM/login manager is X11/xorg?
- mappu 6y agoI'm on SDDM, which is still X - getting itself converted to Wayland is https://github.com/sddm/sddm/pull/1367 https://github.com/sddm/sddm/pull/1367 .
- JeremyNT 6y agoThis is the experience on Arch Linux if you use intel graphics, install gnome and gdm, and then start gdm. For the open source Radeon drivers you have to specifically enable early kms, but I imagine that's done for you with most distributions. Really, this stuff just works if your hardware is well supported (i.e. - not nvidia).
- 6y ago
- zamadatix 6y agoIf you go this "build it piecewise" route instead of a full package DE you'll probably also want notifications, screenshot, a GUI tool for external monitor management (I go as far as using nmtui instead of a widget for networking but absolute detest dealing with sway commands to present on an external screen), battery monitor, and a screen lock/screensaver. Plenty of good options for all the above but sway is not a batteries included DE to choose so you have to find them yourself. Mostly to learn new things I didn't do any xwayland at all. It's definitely been interesting but certainly not what most would want at the moment IMO.
- colingw 6y agoLuckily tools are available for all of that, many of them through Sway directly. Interested folks can check out the Sway Wiki.
- Spivak 6y agoFor screenshots there are currently two competing approaches. GNOME and KDE have opted for dbus interfaces (e.g org.gnome.Shell.Screenshot) and Sway has opted for Wayland protocol extensions (zwlr_screencopy_manager_v1). I think the former is more maintainable because dbus interfaces are accessible by pure cli tools where grim and wl-clipboard have to create dummy wayland surfaces just to talk to the compositor. At least everyone agrees on the notification dbus interface and the tooling is super mature.
- OtomotO 6y agoFunny thing: I was on sway full time for over a year, nearly 2 actually. I went so far as to uninstall i3 (not XWayland, nor X for obvious reasons) Since a few months I noticed weird (complete) freezes/crashes on my pc, while gaming... it's not the youngest so I thought it may come to end of life. Out of curiosity I reinstalled i3 a couple of days ago and used it (only) for gaming. No crash since. I assume it's either a bug in Mesa (AMDGpu) or somewhere in the wayland stack... sway hasn't had an update since November, so... I dunno, I haven't taken the time to investigate. While working I still use sway, because I've customized it to my needs, but for Gaming/Streaming I now switch to i3 again. Nice sideeffect: I can finally play some games again that wouldn't even launch on Sway or were unplayable, like e.g. Natural Selection 2 which turned to a black screen when I switched workspaces (e.g. from one monitor to another) to e.g. tune down the music or scroll down a page while being dead. Feels funny, but more annoying :/
- _bin_ 6y agoWhile I respect Drew's right to keep Nvidia hardware unsupported, doing so cuts out a huge chunk of Linux video game players users. I therefore find it unsurprising that video games have a number of issues that day-to-day use cases don't. Even though this is AMD, lack of Nvidia support keeps Xorg as the default for video games, and this means worse AMD support too.
- OtomotO 6y agoPersonally I don't see how supporting the proprietary nvidia drivers would help my situation as I am using Mesa (and Noveau is supported afaik (?!)) but I assume there is a kernel of truth in there that a lot of people cannot/won't even consider sway because they are on proprietary nvidia stacks. - I wrote before the edit -
- ubercow13 6y agoThe main thing up to now keeping Xorg the default for video games was nVidia's lack of Xwayland acceleration support, which made gaming on Wayland largely impossible regardless of wlroots.
- vetinari 6y agoWrt SDL2: You can actually replace SDL2 with your own, even if it is statically linked with the game. First, do `export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0` and then launch your game. All the gory details: https://www.reddit.com/r/linux_gaming/comments/1upn39/sdl2_adds_dynamic_api_magic_to_allow_updating_it/ https://www.reddit.com/r/linux_gaming/comments/1upn39/sdl2_a...
- pimeys 6y agoI've been using sway a few years already: first in the office workstation with AMD card with Arch, then on my home ThinkPad T25 on NixOS and again on my hobby/travel ThinkPad X230 on FreeBSD that works so smooth and fast now. What's left on xorg/i3 is the workstation with an nvidia GPU, that'll be replaced to an AMD card when the prices come down a bit. I'm super happy with sway. It's adding all i3 patches into one coherent setup. The community is friendly and helpful and the desktop super snappy and pleasure to use from old laptops to extremely fast workstations. Thank you for the developers and community. Edit: dotfiles here https://github.com/pimeys/nixos https://github.com/pimeys/nixos
- rowanG077 6y agoI'm using nixos with i3 and picom. Is sway with wayland really that much better? What day to day thing would I notice?
- pimeys 6y agoIt works the same. What I like in sway is it's basically i3 AND i3-gaps together in an active codebase. The biggest difference you notice is when you get rid of picom the compositor, you'll get visibly snappier desktop... Without really needing any special xorg configuration or picom setup, you get composition, tear-free graphics and videos, all just working. Be aware that to get there, you should make sure you run all your apps in wayland too, not in xwayland. Firefox requires an env var, same goes with GTK and QT apps. Emacs you get from the NixOS overlay; there's a branch that follows the pure gtk build, that doesn't need xwayland. Electron is still xwayland only for most apps. I'm eagerly waiting at least for slack and element to upgrade to Electron 12, which will bring native wayland support. And there's a nice ecosystem building around wlroots and sway, great tools to choose from for your desktop needs, such as waybar, wofi, wf-recorder and greetd. Of course you don't NEED any of this. But if I would think like this, I'd probably just used a macOS machine with default settings anyhoo.
- rowanG077 6y agoSounds good! I just checked around a little bit and the only program I really would like to have wayland support is vscode and that seems to be around the corner. So I will wait for that and then try it out. Thanks for explaining!
- MayeulC 6y agoVery thoughtful guide. Don't forget to launch dbus and policykit is all I can add. I've been using sway daily for about two years now. Here are my current gripes: - Sometimes, client applications do not receive input anymore (mouse/keyboard). This has been a known issue for a while, but I still experience it. - `dpms off` started to crash my AMD-powered PC some time ago, annoying when I configured it to happen with `swayidle` - Sharing screen in browsers worked extremely well... last month or so, when it finally got turned on in Firefox. I didn't change my config, but it isn't working anymore. The handshakes happen, but Firefox or OBS display nothing with xdg-desktop-portal Minor gripes: - Some Wine (proton) games have trouble getting focused (Sins of a solar empire launcher, Evochron mercenary, IIRC). Other play funny, with screen resolution and mouse coordinates (ashes of the singularity, I think). - I launch it with `sway`. After Sysrq+R, I often terminate sway by mistake by pressing Ctrl+C - Very occasional (once every 200 hours or so) crashes. Probably because C.
- josteink 6y agoOff topic, but still... > Alacritty, a modern terminal that "just works" I find alacritty’s slogan funny, because it’s literally the only terminal emulator I’ve used which has been so full of bugs that I found it didn't work for me and I stopped using it.
- Koshkin 6y agoMarketing 101. (I once saw a brand whose product tiers started with "Premium" at the low end.)
- kaba0 6y agoMaybe you tried it really early on? I have had no negative experience with it, and it starts up really quickly.
- MayeulC 6y agoHaha, it just doesn't work on my old samsung n130 that I still use sometimes, probably due to an unsuported opengl version.
- solarkraft 6y agoYay for wlroots based Wayland compositors! Besides the tiling Sway there's also the stacking Wayfire[0] that is from the same family, but modeled after Compiz (blur, desktop cube and good old wobbly windows are all there) and highly configurable. I use it with Waybar[1], wf-dock[2], Sirula[3] as a launcher and a bunch of other small tools like Gammastep[4] (fork of Redshift) for white balance adjustment, grim & slurp [5] for screenshots and mako[6] for notifications. [7] It's a very DIY-y experience, but it's meant to be (if you want something pre-configured you can barely change try Gnome). The combination of getting it just right and the Ikea effect makes for a pretty rewarding result (I also maintain a list of the available desktop tools you can use when on a wlroots based compositor for your DIY needs [8]). The vision for the future is pre-configured DEs being offered on this base and it possibly even offering a lot of Sway's tiling features. [9] It still feels like the early days (for non-Gnome), but with Nvidia driver 470 & accelerated XWayland coming up, the Vulkan efforts, Electron (finally) and Wine making the switch I feel fairly confident saying that 2021 is shaping up to be the year of the Wayland desktop. Free of screen tearing and X-related worries since 2020 :-) [0]: https://wayfire.org/ https://wayfire.org/ [1]: https://github.com/Alexays/Waybar https://github.com/Alexays/Waybar [2]: https://github.com/WayfireWM/wf-shell https://github.com/WayfireWM/wf-shell [3]: https://github.com/DorianRudolph/sirula https://github.com/DorianRudolph/sirula [4]: https://gitlab.com/chinstrap/gammastep https://gitlab.com/chinstrap/gammastep [5]: https://github.com/emersion/grim https://github.com/emersion/grim [6]: https://github.com/emersion/mako https://github.com/emersion/mako [7]: My not-completely-but-fairly Wayfire config https://gist.github.com/solarkraft/f46421295b8c211b2eb56b3acc118cc4 https://gist.github.com/solarkraft/f46421295b8c211b2eb56b3ac... [8]: https://github.com/solarkraft/awesome-wlroots https://github.com/solarkraft/awesome-wlroots [9]: https://github.com/Javyre/swayfire https://github.com/Javyre/swayfire
- samtrack2019 6y agoWhy is wayland better X, sorry i dont know well desktop linux,