Sway and Wayland

Reading the page 107,Chapter 5. The X Window System on the official FreeBSD handbook and the problem is that's the official handbook does not explain something about installing and managing Wayland.
Arrived at this point a question rises in my mind - Is it even possible in 2022 install and use Wayland on any BSD distro to completely dump X11?
If yes how and where i can learn about this stuff ?
Thanks.
 
Yes, i run it just fine for around a year or more. It was little bit involved to setup back then, but now it is very simple, assuming that you are using open source video card drivers, aka i915kms ( thats the one i use ). If you routing to install sway from default pkgs, then the only two things you need to add is seatd deamon i.e sysrc enable seatd. If you, otherwise, want to use ports, make sure BASU option enabled fro all ports it needs. Then, setting up XDG_RUNTIME_DIR would be the second
 
for second part of your question - completely dump X11, is more challenging. For example i use default pkgs from official binary repository, but i do not have xorg-server installed at all. However there are number of small X11-related libraries, such a libX11 installed still , as many software still linking against them. Real example is firefox, it does need cairo and pango and gtk3 to be linked against some X11 libraries. So for as long upstream fix this, you have to deal with them. Reference bug for firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1661450
 
So what's about Nvidia drivers ???
i'm actually using an laptop where the main gpu is an Nvidia GTX 1050 Mobile,can i do something on FreeBSD or it's already an dead start?
 
There are no "distros".

We run the original Berkely Software Distribution Distribution (BSDD)

But which BSDD Distro do you run? ;)

Is it even possible in 2022 install and use Wayland on any BSD distro to completely dump X11?

Even in 3022 there will probably still be fragments of X11 libraries pulled in as dependencies (assuming Wayland is still around by then).

But if you can live with that, I believe sway is working quite well. One possible advantage of having so few options when it comes to compositors is that it should be easier to find specific instructions to get it running.
 
kpedersen There is a difference between distributing a software package and packaging software. FreeBSD is Berkley's distribution of their software to their constituents. A Linux distro (their created term for themselves and no one else) is a description of how they packaged up their kernel with other software as an OS. Not the same thing and not the same context.
 
Yes, i run it just fine for around a year or more. It was little bit involved to setup back then, but now it is very simple, assuming that you are using open source video card drivers, aka i915kms ( thats the one i use ). If you routing to install sway from default pkgs, then the only two things you need to add is seatd deamon i.e sysrc enable seatd. If you, otherwise, want to use ports, make sure BASU option enabled fro all ports it needs. Then, setting up XDG_RUNTIME_DIR would be the second
Note, cmus,seatd,sway,swayidle have option BASU on by default.
 
Note, cmus,seatd,sway,swayidle have option BASU on by default.
I don't understand,what's are those?
Loonix dependencies which use's to keep their software only for loonix?
So this mean's that in order to put Sway on FreeBSD i need to turn on "Linux Binary Compatibility" mode ?

P.S. I'm totally newbie.
 
you don't need to worry about this option. i don't know what is loonix, maybe a fun word for linux?
you don't need to turn on Linux Binary Compatibility to setup sway.
 
Got 1 last question.
By installing Wayland + Sway or Kde do i need to install some systemD trash or i can avoid it completely?
Thanks.
 
We run the original Berkely Software Distribution Distribution (BSDD)
Actually we don't run the original code. FreeBSD use the code from "Jolix" (386BSD) which was written Lynne Jolitz and William Jolitz. That's why FreeBSD or NetBSD had no problems when UNIX System Laboratories, Inc. made a lawsuit against Berkeley Software Design, Inc. (BSDi) [BSD/OS a.k.a BSD/386]
and The Regents of the University of California.
Berkeley Software Design Inc. (BSDi) is the actual iXsystems, Inc. which developed PC-BSD (TrueOS) and now "develops" TrueNAS.
 
this is no such a strict requirement or forcing of xwayland, however, it varies on a software you use. there is no such software on my box. i also set xwayland disable in my sway config.
 
this is no such a strict requirement or forcing of xwayland, however, it varies on a software you use. there is no such software on my box. i also set xwayland disable in my sway config.
Just because you disable xwayland in the config, it doesn't mean much of Xorg isn't still linked in the program and all over the hard disk as a fairly sizable dependency.
 
PizdeX this is a few days late: welcome to FreeBSD Forums.

If you like, join the discussion under <https://forums.freebsd.org/posts/551445>; there's some insight into how the FreeBSD Foundation is improving things for laptop users.

… laptop where the main gpu is an Nvidia GTX 1050 Mobile …

Elsewhere in the forums there are a few mentions of GTX 1050, but maybe not Mobile. If you'd like to start a new topic with NVIDIA GeForce GTX 1050 Mobile in the title, it'll be easier for people to provide focused help. Thanks.
 
I should prefer to discuss Sway and Wayland.



Historically, the problems are largely elsewhere in the forum. Drawing attention to things that were far from nice, with or without external archives, might cause excitement in the short term, but ultimately: it will not look good. Ugliness breeds ugliness.

Please, let's all move on, with mutual respect, with respect for all FreeBSD communities. Be nice. Be nice, everyone.



Here, let's discuss Sway and Wayland.
 
Reading the page 107,Chapter 5. The X Window System on the official FreeBSD handbook and the problem is that's the official handbook does not explain something about installing and managing Wayland.
Arrived at this point a question rises in my mind - Is it even possible in 2022 install and use Wayland on any BSD distro to completely dump X11?
If yes how and where i can learn about this stuff ?
Thanks.
If you still need help and direction, I can give you some tips or guide, (or for anyone else), but I don't have an NVIDIA card so you will need to test that. I had heard NVIDIA added support a while ago and a quick search shows that it is working fine with driver 470 on Linux, which is in ports, so you may be in luck. If you get past that part, sway and wayland is easy to setup, works well and there are plenty of ports and packages that work with it.
Wayland might not be as popular yet for a handbook section, but the handbook chapter 5 that you mention (X Window System), still has the steps necessary to setup the graphics card for wayland too; just skip the parts that install and setup xorg and do everything else (you can uninstall xorg if you had already). There are a few settings after that, then install sway, a terminal emulator and you are basically done for a basic setup.
I'll go over the process, but here are some notes beforehand.
Wayland with window managers/compositors like Sway, Hikari, Wayfire etc work well but something like KDE on wayland probably still doesn't, idk. Avoid login/session managers like lightdm/sddm for now, sometimes they work, sometimes they break, try them later. Just run sway from tty. Also, just use packages (don't build ports) and it is probably better to set pkg to latest instead of quarterly right now. There were some newer versions of wayland, wlroots and sway added not long ago and I'm not sure what versions quarterly has at this point.

1) Setup. (don't know if you still need or did this part, it's considering a fresh freebsd install, skip ahead if needed).
- Update system if needed
#freebsd-update fetch install
reboot

- Change packages to latest
#mkdir -p /usr/local/etc/pkg/repos
Create a file called FreeBSD.conf containing
Code:
# /usr/local/etc/pkg/repos/
FreeBSD: {
    url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}
Copy it to /usr/local/etc/pkg/repos/ (The comment in first line reminds you where it goes if you want to save it for later). Type #pkg -vv to check.

- Install packages like sudo and set it up. Editors like vim, neovim or whatever you need here.

- Install the graphics drivers as per chapter 5.4.3.
For my amd card I just #pkg install drm-kmod and add amdgpu to kld_list in /etc/rc.conf #sysrc kld_list="amdgpu"
For nvidia, I think it's #pkg install nvidia-driver (not sure if you need nvidia-xconfig too for wayland). If that is the right one, you can try loading the module with #kldload nvidia-modeset before adding it to load on boot (in case it crashes). If it works fine, add it to kld_list #sysrc kld_list="nvidia-modeset". Otherwise search for how to set up nvidia drivers (this part is the same as for xorg setups, just find the right way for nvidia and skip the xorg installs).

- Add your username to video group (and repeat for wheel group if you didn't already for sudo)
#pw groupmod video -m joebloggs
- Add procfs to /etc/fstab with this line
proc /proc procfs rw 0 0

- Install Sway, dbus and a terminal. Alacritty is always reliable.
#pkg install sway swayidle swaylock-effects alacritty dbus
You can run #pkg search sway and install anything else you need from the list (but not needed)

-Enable dbus and seatd
#sysrc dbus_enable=YES && sysrc seatd_enable=YES

-Add the environment variable XDG_RUNTIME_DIR to your shell. It can be /tmp, /var/run/user/{and your UID} or even a folder under home dir, as long as it's set.

That is it for sway to run. You can mount proc and run the services manually, then just type sway on your user account to run it, or just reboot to check if everything is working.. After reboot, check that /proc is mounted with #df.
Unlike x11, which uses tty9(F9), sway uses 1 or 2 ( i forget) but CTRL+ALT+F# keys work the same to switch to ttys.

2) Extra stuff.
- There are some extra environment variables you can set in your shell. Some are
MOZ_WAYLAND_ENABLE=1 If you use firefox (and thunderbird)
GDK_BACKEND=wayland For gtk packages
QT_QPA_PLATFORM=wayland For qt5 packages. Requires qt5-wayland manual install
TERMINAL=alacritty Doesn't hurt to have, required by hikari if you decide to use it. change accordingly
Some others that I didn't find necessary, but...
XDG_DEFAULT_RULES=evdev
SDL_VIDEODRIVER=wayland
CLUTTER_BACKEND=wayland
QT_WAYLAND_DISABLE_WINDOWDECORATION=1 (never saw a difference really)

- Copy the default config to your folders
#cp -r /usr/local/etc/sway ~/.config/. Edit to suit or check keybindings in ~/.config/sway/config

- I usually install mesa-gallium-va and mesa-gallium-vdpau for hardware acceleration, and mpv to check that my gpu is running fine (even in xorg). if you run mpv from command-line, it will show Dropping frames if there are hiccups, otherwise it's fine. Just
#mpv filename and #mpv -hwdec=auto filename

- Apart from that, you can look for wayland packages like I did. Google 'are we wayland yet" for a list, then #pkg search anything on the list to see if we have them on freebsd. Most are, not all. (the list is for linux).

- If you had xorg installed #sudo pkg delete xorg and #sudo pkg autoremove
 
To whom it may concern: If you don't want to end up in constant and painfully slow moderation queues, I suggest the (mutual; removed) sniping ends here. Looking the other way is a legal turn here.
 
Back
Top