I see that as of sway 1.6/wlroots 0.13 it is possible to launch and run sway without suid or elogind. Sway/wlroots now supports libseat, and libseat can be built for either (e)logind and/or its own seatd backend (although the existing seatd AUR package compiles with logind). The seatd backend looks sane, as opposed to (e)logind.

The sway wiki has not yet been updated, so it still only describes the setuid and elogind methods. However, I have converted my setup and have sway successfully running under Obarun without any need for elogind.

I had been running sway for some time - in particular because my laptop display and my monitor have different screen resolutions. X does not seem to handle this well, no matter what I do via XRandR. My setup was Obarun with SDDM and Sway, using elogind. I have now re-configured to use seatd, and since elogind is gone, I am using greetd with gtkgreet in place of SDDM. (I like my graphical login screen.)

The Obarun modules made this easier. I defined 'seatd-66serv' and 'greetd-6serv' packages, and used the boot-user@ module to add a 'boot-user@ greeter' service using:
# # Uncomment it to use a display manager.
# # Can be any display manager as long as the
# # corresponding frontend file exist on your system
# # e.g sddm,lightdm,...
# # It also prepare the .xsession file.

DISPLAY_MANAGER=!greetd

# # Uncomment it to use a console tracker.
# # Can be any console tracker as long as the
# # corresponding frontend file exist on your system
# # e.g consolekit,elogind,...

CONSOLE_TRACKER=!seatd

# # Create and mount the XDG_RUNTIME directory
# # at /run/user/greeter [yes|no]

XDG_RUNTIME=!yes

# # Command to use in your .xinitrc
# # to launch your desktop e.g.: openbox-session.
# # If commented the .xinitrc file is not configured.

# DESKTOP_CMDLINE=!jwm
I'm currently testing a couple of PKGBUILDs that I will make available to easily reproduce this setup. However, the wlroots package in the obcommunity repo has seatd support disabled. Perhaps the time has come to update the wlroots package and add a seatd package to the obarun repos? I'd like to help if I may.
Great work all around

someone I told about this is asking if greetd works as well with this setup, no ck no elogind, I may have to try this myself but not today ..

if you made the seatd-66serv after consoletracker-66serv did you use the ck2 dependency? Last I tried consoltracker it started ck on its own...
This is really cool and interesting. Many thanks for sharing your story.
Perhaps the time has come to update the wlroots package and add a seatd package to the obarun repos
done

Can please you share the seatd and greetd frontend files?
I've uploaded package sources for these services to https://framagit.org/xprl-obarun-contrib-wayland

I'm working on an additional package to install the files needed to setup and run the greeter: ob-gtkgreet-sway
However, I've reached the limit of my PKGBUILD-fu. I want to create a new user with a home directory, and then I need to create the home directory for that user.

So far, I have:
# create the obgreet user with a home directory at /var/lib/obgreet;
# so that additional sway config can be added to /var/lib/obgreet/.config/sway/config.d/
# and gtkgreet can be styled via /var/lib/obgreet/.config/gtkgreet/gtkgreet.css
# (assuming XDG_CONFIG_HOME is /var/lib/obgreet.config)
cat <<EOF | install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/obgreet.conf"
u obgreet - "obarun greetd greeter user" /var/lib/obgreet -
m obgreet video
EOF

cat <<EOF | install -Dm644 /dev/stdin "$pkgdir/usr/lib/tmpfiles.d/obgreet.conf"
d /var/lib/obgreet 0755 obgreet obgreet - -
EOF
The pacman 'obsysusers.hook' creates the user. But is there a similar hook process available to parse the 'tmpfiles.d'?
/usr/lib/66/script/tmpfiles.sh

I may not understand what you need, but see if this helps

It is used in the boot@ module found here:
/usr/lib/66/service/boot@ ***/service/local/local-tmpfiles
To complement what @ fungal_net said, all files found at /usr/lib/tmpfiles.d will be applied if you have set TMPFILE=yes at your boot@ system configuration file. The service local-tmpfiles will launch the /usr/lib/66/script/tmpfiles.sh.

Also, you can add a post-install() function at your greetd.install file and launch the script with:(see Others -> install at https://wiki.archlinux.org/index.php/PKGBUILD)
/usr/lib/66/script/tmpfiles.sh --create
By the way, thanks for sharing this. All Obarun users will appreciated it.

We really need now an OUR, to provide a central place for the community to share a works.

Also, you can simplify a little bit your frontend service file (i assume you use the last version of 66). You can safely remove the field @ build = ( auto ). This field is automatically set to auto if it not present.
You can safely remove the field @ options = ( log env ). The log is always created except if you explicitly ask to not create it like @ options = ( !log ). The options env will be automatically added if you define the [environment] section.
Thanks for your suggestions @ fungal_net and @ eric.

I've finally got a package that I'm happy with, and uploaded to https://framagit.org/xprl-obarun-contrib-wayland/ob-gtkgreet-sway.

It adds an 'obgreet' user, with config and scripts needed to launch sway/wlroots using seatd. The primary intended usage is for the 'obgreet' user to launch a gtkgreet greeter using sway/wlroots. This is as simple as adding the 'boot-user@ obgreet' module to the boot routine.

However, even if you are not using the 'greetd' greeter, it still provides a convenient collection of scripts and config to launch a wayland session under Obarun, via a 'wayland-session' script that is installed to /usr/bin.

Full details are in the README at https://framagit.org/xprl-obarun-contrib-wayland/ob-gtkgreet-sway/-/blob/master/README.md.

Please, take this package and make of it what you will.
I tried this and got it started, used main arch repository sway and wlroots from obcommunity ...
I disabled xwayland on /etc/sway/config but still I don't know whether it is running on wlroots or not.
My screen was abou 1/3 size and I couldn't adjust, then I noticed some of the sway executables were throwing linsystemd errors.
So I tried to build aur's next version of wlroots-git and built it , but sway-git I couldnd't and it is needed in conjunction to wlroots-git 0.13

I also noticed that swaybg is not a branched subprocess, it starts its own main branch

I am a little lost, if you can throw some light to a sway/wayland nube.
I've been running sway for awhile now on Arch, trying now on obarun with this guide failed me.

sway-desktop, wayland-session is not working on my end, So, i ditched using a login manager and instead use my ownsession file which consists of:
- export XDG_RUNTIME_DIR=/run/user/$uid # sway does not run without it
- 66-all up # starts my user service modules
- sway

aside from seatd enabled on root tree, also needed the session-file to be launched with ck-launch-session dbus-run-session <session-file>, (got to do with automounting in gui filemanagers for one)

fungal_net wroteI tried this and got it started, used main arch repository sway and wlroots from obcommunity ...
Ooh. I am a bit surprised. I thought wlroots from obcommunity is still 0.12, and the gtkgreet greeter requires wlroots 0.13. Did you bypass the greeter and launch sway directly using `wayland-session sway`?
I disabled xwayland on /etc/sway/config but still I don't know whether it is running on wlroots or not.
Two tricks to tell whether or not a window is using xwayland:
1. Add the following to your sway config: (taken from this reddit thread)
for_window [shell=".*"] title_format "%title :: %shell"
Native wayland windows will display `:: xdg-shell` in the window title.
2. More fun, but becomes tedious: run `xeyes`. It will only respond if the mouse is over an xwayland window.
My screen was abou 1/3 size and I couldn't adjust, then I noticed some of the sway executables were throwing linsystemd errors.
These are propably unrelated. For the systemd errors, has the sway package installed `/etc/sway/config.d/50-systemd-user.conf?` I simply deleted that file (actually, symlinked it to /dev/null to maintain package integrity while disabling the file).

The screen size is entirely determined by `sway-output` commands in your sway config (`~/.config/sway/config`).
So I tried to build aur's next version of wlroots-git and built it , but sway-git I couldnd't and it is needed in conjunction to wlroots-git 0.13
Recent versions of sway-git require sd-bus support. The minimal non-systemd version of sd-bus is basu. So perhaps you can build sway-git if you have basu installed? (Although you may still need to patch the PKGBUILD.) Looking into this on my own machine, I was able to build sway-git because I still have libelogind kicking around, so sway-git build against that. But I don't run elogind; I run seatd instead.
I also noticed that swaybg is not a branched subprocess, it starts its own main branch
You are right. Any programs started via `exec` in your sway config run on their own branch. e.g. swaybg, swaybar. However, they are killed when sway exits.
I am a little lost, if you can throw some light to a sway/wayland nube.
Hope this helps. It still takes a bit of effort to get a more fully-functioning desktop on sway. I have built, installed and configured: swaybg, swayidle, swaylock, swaynagmode, and mako for desktop notifications. I use i3status on my swaybar, but there are now plenty of alternatives available. Endless hours of tinkering await... :)
negative wroteI've been running sway for awhile now on Arch, trying now on obarun with this guide failed me.
What was the error?

The 'wayland-session' script should setup the XDG_RUNTIME_DIR for you. And if you edit your `~/.wayland-session` file to export the USERSESSIONSERVICETREE env var, then your service modules will be started for the session. So it is intended to be a more convenient way of getting sway running, essentially by doing what you are doing manually. If it is not working for you, it would be helpful for me to learn why not.

Note that I updated the ob-gtkgreet-sway package yesterday such that it now logs the stdout/stderr from the wayland session to ~/.66/logs. It may be helpful to update to this version?

The most likely cause of failure is because the 'wayland-session' setup of XDG_RUNTIME_DIR relies on the 'boot-user@ ' module for your user; specifically the
XDG_RUNTIME=!yes
setting; this activates the 'mount-run@ ' and 'setenv@ ' services for your user. So it would be helpful if you can confirm that the 'mount-run@ negative' and 'setenv@ negative' services are up (assuming 'negative' as your username) via 'sudo 66-intree'?

Finally, I am running the dbus system bus via a 'dbus' service on the root tree, and have enabled 'dbus-session@ ' on my own user tree (that is exported as the USERSESSIONSERVICETREE) as per the Obarun wiki recommendations I don't use ConsoleKit at all.
Thank you, I'm going to try those tricks, mainly I wanted to see it running. I am not exactly clear on what to do about 12/13 main or AUR/git versions .. The sway-nosystemd-git pkg by shouber420 doesn't build
meson.build:1:0: ERROR: Value "enable" (of type "string") for combo option "Enable support for more image formats in swaybg" is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".

A full log can be found at /tmp/...../aur-sway-nosystemd-git/src/build/meson-logs/meson-log.txt
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build sway-nosystemd-git.
for Basu it seems I should make a PKGBUILD, I don't see one ready anywhere

I took a look at void's collection:
[-] Waybar-0.9.5_2        Polybar-like Wayland Bar for Sway and Wlroots based compositors
[-] autotiling-1.5_1      Automatically switch horizontal/vertical split orientation in i3/sway
[-] azote-1.8.1_1         Wallpaper & color manager for Sway, i3 and other WMs
[-] grimshot-1.5.1_2      Helper for screenshots within sway
[-] python3-i3ipc-2.2.1_4 Improved Python library to control i3wm and sway
[-] sway-1.5.1_2          Tiling Wayland compositor compatible with i3
[-] swaybg-1.0_1          Wallpaper tool for Wayland compositors
[-] swayidle-1.6_1        Idle management daemon for Wayland
[-] swaylock-1.5_1        Screen locker for Wayland
[-] Waybar-0.9.5_2                 Polybar-like Wayland Bar for Sway and Wlroots based compositors
[-] fuzzel-1.5.1_1                 Application launcher for wlroots based Wayland compositors
[-] wayvnc-0.3.1_1                 VNC server for wlroots based Wayland compositors
[-] wdisplays-1.0_2                GUI display configurator for wlroots compositors
[-] wf-recorder-0.2.1_1            Screen recorder for wlroots-based compositors
[-] wlr-randr-0.2.0_1              Wayland clone of xrandr for wlroots compositors
[-] wlroots-0.12.0_2               Modular Wayland compositor library
[-] wlroots-devel-0.12.0_2         Modular Wayland compositor library - development files
[-] xdg-desktop-portal-wlr-0.2.0_1 Backend of xdg-desktop-portal for wlroots
[-] seatd-0.5.0_1 Minimal seat management daemon
So maybe I should give it a try there as well
got it to work...

apparently, setting .waylang-session file is mandatory instead of optional, because command "unset DISPLAY" is there. now, running sway-desktop launches sway now instead of some errors i forgot what its about. and btw, i am using $SHELL login since i dont get how to run greetd with gtkgreet (example shows cage instead of agreety. This means i had to move greetd tty to use tty3 instead, avoids login conflict with agetty. ill just probably use my modified Ly for login with a .desktop file for sway-desktop or something.

with regards to the location of the .wayland-session, can we use standard directories or XDG specifications instead of placing this on $HOME?
negative wrotewith regards to the location of the .wayland-session, can we use standard directories or XDG specifications instead of placing this on $HOME?
https://framagit.org/xprl-obarun-contrib-wayland/ob-gtkgreet-sway updated (pkgrel=3).

wayland-session script now looks first in XDG_CONFIG_DIR, then fallsback to home dir when looking for the .wayland-session config file.
bbsg wrote
negative wrotewith regards to the location of the .wayland-session, can we use standard directories or XDG specifications instead of placing this on $HOME?
https://framagit.org/xprl-obarun-contrib-wayland/ob-gtkgreet-sway updated (pkgrel=3).

wayland-session script now looks first in XDG_CONFIG_DIR, then fallsback to home dir when looking for the .wayland-session config file.

thanks btw, can you tell me how to get greetd working with gtkgreet (just for consistency)?
Have you tried following the instructions in https://framagit.org/xprl-obarun-contrib-wayland/ob-gtkgreet-sway/-/blob/master/README.md# usage? If so, what happened?

Following those instructions should configure greetd to to run gtkgreet via sway, as the 'obgreet' user.

The relevant config is:
1. /etc/66/conf/greetd/version/.greetd (but to edit this, please use 'sudo 66-env -e nano -t XXX greetd', where XXX is the tree under which the greetd service is running). This config file instructs greetd to use:
2. /etc/greetd/config.obgreet.toml. This config file instructs greetd to run a wayland session on vt7, for user 'obgreet', using sway config file:
3. /etc/greetd/sway.config. This config file configures sway to run gtkgreet, and loads additional sway config and gtk stylesheets.

You can test the sway config simply by running 'wayland-session sway --config=/etc/gtkgreet/sway.config' (you probably need to be root).
You can test greetd config by running 'greetd -c /etc/greetd/config.obgreet.toml' as root.
The greetd service is started automatically using this config if you specify greetd as the 'DISPLAY_MANAGER' for the boot-user@ obgreet service as per the README.

Hope this helps you.
fungal_net wroteI am not exactly clear on what to do about 12/13 main or AUR/git versions ..
Too true. I am using sway-hidpi-git and wlroots-hidpi-git from AUR, although I modified the PKGBUILD for wlroots-hidpi-git.

The '-hidpi-' was to work around issues with blurry fonts on XWayland applications - given I am running with multiple monitor resolutions. But I'm not sure if that is still relevant or needed. Certainly less so now that emacs is available with native Wayland support via the 'pure-gtk' branch!

My patch for the wlroots-hidpi-git PKGBUILD:
--- PKGBUILD	2021-03-16 10:06:55.000000000 +0000
+++ PKGBUILD.seatd	2021-04-09 12:38:19.433718947 +0100
@ @ -1,7 +1,7 @ @
 # Maintainer: Antonin Décimo <antonin dot decimo at gmail dot com>
 # Contributor: Adrian Perez de Castro <aperez@ igalia.com>
 pkgname=wlroots-hidpi-git
-pkgver=0.12.0.r378.g00bee2a6
+pkgver=0.13.0.r5.g78befa59
 pkgrel=1
 license=(custom:MIT)
 pkgdesc='Modular Wayland compositor library, with XWayland HiDPI (git version)'
@ @ -22,7 +22,7 @ @
 	xcb-util-errors
 	xcb-util-renderutil
 	xcb-util-wm
-	systemd)
+	seatd)
 makedepends=(
 	git
 	meson
@ @ -33,7 +33,7 @ @
         "xwayland_hidpi.diff::https://github.com/swaywm/wlroots/compare/master...MisterDA:xwayland_hidpi.diff"
        )
 sha512sums=('SKIP'
-            '3f72a84ffdbdcafb40a28c563fabac9d231441cf17304121f2c083a35bdd477ea95a0baf26a08f77907d2d4e99f1c510d2d7f60b1896fb10fe1ce7164ae04c9e')
+            'SKIP')
 
 pkgver () {
 	cd "${pkgname}"
@ @ -51,8 +51,8 @ @
 
 build () {
 	arch-meson \
-		-Dlogind-provider=systemd \
-		-Dlibseat=disabled \
+		-Dlogind=disabled \
+		-Dlibseat=enabled \
 		-Dwerror=false \
 		-Dexamples=false \
 		"${pkgname}" build
Hope this helps you.
apparently now. as i have stated earlier, i AM already running with greetd, but the default command runs $SHELL (agreety --cmd $SHELL) instead of running gtkgreet, that the default config file that came with it.
negative: You cannot configure greetd to run gtkgreet directly. You _can_ configure greetd to run sway. And then you can configure sway to run gtkgreet.

My package configures greetd to run:
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 7

# The default session, also known as the greeter.
[default_session]
command = wayland-session sway --config=/etc/greetd/sway.config

# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "obgreet"
As long as the selected user can run a wayland-session, then this will work. You then need to ensure that the selected sway config includes 'exec gtkgreet' somewhere.

Powered by Obarun