3bd's webpage - - + { O 0 0 O } + - - Blog | Projects | Contact | About ________________________________________________________________________________ I am migrating to wayland and gonna ditch old the old X11 system. How hard could that be? [000] Why not just stick with Xorg? [010] What exactly is "wayland" and how do I get it? [020] Choosing a compositor. [021] KDE/Gnome should work fine. [022] Sway. [023] Hyprland. [024] Other minimalist WM. [030] Me trying to figure out wayland stuff. [040] My setup and config.h file. [041] Migrating my old X11 programs to wl. [042] Utils I use. [043] My config.h file. [000] Why not just stick with Xorg? If you asked me about wayland 3 years ago, I would instantly answer "immature windowing protocol!" But now, after LONG years of development of the protocol wayland, I (and a lot of people) think it's actually mature enough for mass usage. Xorg is OLD, it's even older than Linux. Time to put it on the "forever sleeping bed". Just imagine a protocol that, if it was a human being, it would have been required to retire by the law of most countries. Now, we need a replacement for the old grandpa, and that is wayland. [010] What exactly is "wayland" and how do I get it? "Wayland" is not a thing you can install and run. It is just a protocol that says how things should be done and in which order. Instead of what Xorg does (single "standard" server implementation), wayland allows basically everyone to implement their own "server" and in the way they like. One another major difference is, there's no server/compositor, they're merged. They call it a compositor, even tho it's not technically required to compose, but to serve clients and draw their windows (surfaces). To start a wayland compositor, there's no standard "startx" program. Every compositor have their own commands to start. [020] Choosing a compositor. [021] KDE/Gnome should work fine. Unless you have specific uses or want to customize every single little thing in your environment, you can just use a Desktop Environment (DE) that supports wayland and you should be good to go. I recommend KDE, Gnome is kind of a mess, but they both should be fine. [022] Sway. swaywm.org is the one for the i3 folks who want a seamless wayland transition. The config file is a copy+paste and a changing X11 names to wayland names. Simple as that. [023] Hyprland. hyprland.org is the new & fancy wayland Window Manager (WM) that has the most eye-candy for the Linux desktop. I don't recommend this unless you want eye-candy, because it's so unstable. Imagine if you need to rewrite your config file every week for the rest of your life just to get the latest eye-candy, and the config file isn't even easy to understand! [024] Other minimalist WM. To write a WM, you would need a library for composing or you would need to write the entire wayland compositor logic yourself. Yuck. There are libraries that do that, such as "swc" and "wlroots". Common WMs who use them are Sway and Hyprland. Here are some of the less popular ones: * codeberg.org/dwl/dwl * github.com/michaelfoney/velox * Find out others at wiki.archlinux.org/title/wayland [030] Me trying to figure out wayland stuff. I thought of trying wayland this spring holiday and so I did. Because I am a minimalist type of guy, I chose to go with dwl. After patching and fixing build errors. It worked flawlessly, if you count flawlessly as just a black screen with nothing on it and no way to interact with it. It turns out that they used alt as the mod key instead of the win key. OK, I checked the config.h this time and installed a wayland terminal emulator called "foot" and a menu launcher called "wmenu", they worked. But the default configuration of them is wack, so I changed it ofc. [040] My setup and config.h file. [041] Migrating my old X11 programs to wl. I've written some X11 program over the years that use depend on parts of the X11 windowing system, like sxmag and my bookmarks program. Most of them are a simple "change the menuing thingy from X11 to wayland" but others needed to have a full rewrite/abandon them. One example is Jisb, my old status bar. I have to rewrite it to use the dwl-specific way to do it. Oh right, did I forget to tell you that, in wayland, once you dive deep find stuff are compositor specific! [042] Utils I use. Most of the utilities I use on Xorg have direct replacements, for example: * xdotool with ydotool * dmenu with wmenu (or bemenu, more on that later) * xkbmaps are now built into the compositor (exact same config & interface) Some I didn't have a replacement to, such as the systray, which I ended up with using bar-systray.patch on my dwl rice. Some replacements turned out to be "inefficiently written", specifically talking about wmenu, which is fast for every-day use. But I had an "abnormal" type of menu selecting, I used to have a dictionary program, which I just press win+shift+insert and a window would pop up to show a list of all the words in a dictionary. On X11 and with dmenu, it would launch up in an instant! But with wmenu it took almost 2 seconds. Add to that the high CPU usage and my need to "just remember the spelling of that specific word I forgot how to spell" and you'll get a bad experience. wmenu is not fast enough for me, so I did replace it with bemenu, which was fast, like really fast. It's faster than I can notice my finger leaving the insert key! Note: not to say wmenu is bad or something, it just couldn't handle big stuff (think in thousands of lines) [043] My config.h file. Nothing special, I just applied the bar and bar-systray patches. Edited a value here and there, and I was read to go. My configuration on wayland is WAY simpler than the one with Xorg. If I have deleted my .config then I wouldn't know where to start to rewrite my Xorg config (years of tinkering), but with wayland it is simple... hold on a second... maybe that was the idea all along. JUST WRITE GODDAMN SIMPLE SOFTWARE!! ________________________________________________________________________________