KDE Plasma (Wayland) and SDDM Queries

I did give Wayland on Tumbleweed KDE a try yesterday and it worked.

Took some time to find out how to switch, in the end I learned that at login you can select it. During my normal boot I do not see a login screen and I have disabled plymouth so I can see the boot messages.

Is there a way make Wayland the default instead of X11? I did do some searching, but it does not seem an easy question. I would think you should be able to change some systemd setting to accomplish this.

That is handled by the display manager in question. With SDDM and GDM at least, they remember the last desktop session chosen.

If so, this information should be somewhere in a I think. I would prefer updating this “setting file” as I do not have the option to chose my desktop session during boot.

For KDE the SDDM is the recommended display manager so I assume I am running with that.

Next I had a look in /etc/sddm.conf (empty) and /etc/sddm.conf.d/ (no files) so no SDDM settings while I have autologin enabled. On the SDDM Arch wiki I see autologin can be enabled using a SDDM configuration file but that is not there so I think the autologin is no trough SDDM.

I saw the section “Running under Wayland” and the Arch SDDM wiki and will give that a try, but see above, I am skeptical that will work.

No one has. You choose the desktop at login: the DM login screen and that is thus after boot is completed.

(BTW, you of course see no GUI login screen when you use “automatic login”, but I assume you understood that already).

And all DM login screens I am aware of have somewhere a button where you get a menu that shows what Desktop Environments are available (including at least a very basic “fall back” one to be used when your normal one is borked for some reason).

Also, as @deano_ferrari said. most DMs will use the last one used by a specific user when that user loges in again without making an explicit choice.

It’s easy enough to confirm the display manager. For example…

ps -A|grep dm

or

systemctl status display-manager

In any case, for SDDM the last active session selection is recorded in /var/lib/sddm/state.conf

2 Likes

@hcvv : Sorry for using the wrong terminology, for “desktop session” I did meant that for the boot till “graphical.target” I have no interaction apart from typing in the password for for my encrypted /home folder.

@deano_ferrari : Thanks for listing how to check which display manager is active and yes, it is SDDM.

> sudo cat /var/lib/sddm/state.conf
[Last]
# Name of the last logged-in user.
# This user will be preselected when the login screen appears
User=marel

# Name of the session for the last logged-in user.
# This session will be preselected when the login screen appears.
Session=/usr/share/xsessions/default.desktop

So the last user but no instruction for autologin.
The Session key is however interesting:

> cat /usr/share/xsessions/default.desktop
[Desktop Entry]
Type=XSession
Exec=/usr/bin/startplasma-x11
TryExec=/usr/bin/startplasma-x11
DesktopNames=KDE
Name=Plasma (X11)

I guess that have to be change to have KDE run using Wayland.

Next I had a look in /etc/sddm.conf (empty) and /etc/sddm.conf.d/ (no files) so no SDDM settings while I have autologin enabled.

Marel, I apologize. I goofed in my first Wayland-related post, linked above. The file I edited was:

/etc/sddm.conf.d/kde_settings.conf

to which I added the line:

RememberLastSession=true

I hope this helps, and I’m glad that Wayland is working out for you.

Setting the desired session at the login screen is all that is required.

At present, the version of sddm shipping with Tumbleweed does not offer the possibility of running as a wayland session, it’s X11 only.

What do I mean by that?

sddm itself currently runs in X11, and then when you login to a Plasma-wayland session, it switches to wayland. There are fixes/updates coming, there is just some issues upstream that are holding up a fresh sddm release.

So for the moment, at least on openSUSE, unless you’re going to pull in an sddm git pull from a devel project, having a pure wayland environment isn’t possible.

I switched to Wayland for a few hours before I had to rollback. There were two glaring issues.

  1. You can’t actually access your settings anymore. All gui applications which adjust systemwide settings now throw Wayland does not support QWindow::requestActivate() errors. Making adjusting anything after switching to Wayland an impossible feat.

  2. Wayland has no definable way of setting a “primary” monitor, there’s no such thing in Wayland. I have two monitors stacked on top of eachother, display port on bottom, hdmi on top. Wayland was defaulting applications to the top screen no matter what because I guess hdmi comes before displayport in whatever order it looks for monitors. If I fired up a game, it would force it on the 60hz monitor, not the 144hz one.

KWin should handle the preferred display layout, and remember the desired window placement of a given application when next opened.

Which applications are causing this behaviour?

If it’s an application that can be launched by y2controlcenter or systemsettings (including those applications themselves) the error was thrown. I’m not about to make a list of them all.

I don’t know what went wrong, but if I had the game Windowed, of course I could drag it to the lower monitor. If I tried to fullscreen/borderless window the application, it would force on HDMI. X11 session always had placement on displayport, so if wayland kept it’s own settings separate, it always put the desired window as HDMI, regardless if I closed the window on the displayport monitor, it would reopen to those coordinates on the HDMI monitor.

EDIT: I’ve swapped to Wayland after making a snapshot to see if I could reproduce this behavior. So far it’s fine. I am unsure how these previous hiccups happened but will update as soon as I run into them.

Ok, I haven’t observed that, but was just trying to get a handle on whether this was occurring with XWayland launched apps, GTK apps etc. In any case, when you get such an issue, best to start your own dedicated thread discussing such.

Wayland is just a protocol - it is KWin (the window manager acting as the Wayland compositor) that is responsible for this behaviour, and that may be totally different to how other such (Wayland) compositing window managers behave.

I do not have that file but based on the suggestion of @deano_ferrari I did boot my machine, did Log out, change for X11 to Wayland in the Log in screen and after that I see:

> sudo cat /var/lib/sddm/state.conf
[sudo] password for root:
[Last]
# Name of the last logged-in user.
# This user will be preselected when the login screen appears
User=marel

# Name of the session for the last logged-in user.
# This session will be preselected when the login screen appears.
Session=/usr/share/wayland-sessions/plasmawayland.desktop

So the last line changed, it was /usr/share/xsessions/default.desktop and now this plasmawayland.desktop file has:

[Desktop Entry]
Exec=/usr/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland
TryExec=/usr/bin/startplasma-wayland
DesktopNames=KDE
Name=Plasma (Wayland)

Unfortunately, after a reboot (initiate with Wayland active and the sddm/state.conf as above) I still boot (autologin - so no login screen) into X11. I also tried adding “RememberLastSession=true” in a /etc/sddm.conf.d/ file but still after a reboot I have X11.

Next I did check the SDDM configuration:

> cat /usr/lib/sddm/sddm.conf.d/00-general.conf
[XDisplay]
ServerPath=/usr/bin/X
SessionCommand=/usr/etc/X11/xdm/Xsession
DisplayCommand=/usr/etc/X11/xdm/Xsetup
MinimumVT=7
# boo#1089932
EnableHiDPI=true

[Users]
# boo#979775
ReuseSession=true

So that is all X11, I guess I have to create a file in /etc/sddm.conf.d/ to override these settings to Wayland equivalents.

Isn’t that way is being addressed in Running under Wayland?

I know how I can check that KDE is running Wayland (echo $XDG_SESSION_TYPE) but how do I check what SDDM is running?

Yes, it is being addressed as already mentioned. However, it isn’t released as an openSUSE package yet. You can test sddm 0.20 with full Wayland support (via sddm-git), but I’m not sure what dependency issues you may run into. More info here:
https://wiki.archlinux.org/title/SDDM

Run

ps -ef | grep sddm

and you’ll see it is launched on tty7 as a process running under X.

1 Like

Watch the journal:

erlangen:~ # journalctl --since 5:00 -u display-manager.service -p6
May 29 05:09:28 erlangen sddm-helper[8004]: pam_unix(sddm-greeter:session): session opened for user sddm(uid=477) by sddm(uid=0)
May 29 05:09:44 erlangen sddm-helper[8070]: pam_unix(sddm:session): session opened for user tester(uid=1005) by tester(uid=0)
May 29 05:09:44 erlangen sddm-helper[8070]: Starting: "/usr/share/sddm/scripts/wayland-session /usr/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland"
erlangen:~ # 

This is caused by SUSE patch that sets default session for autologin to X11. You need to explicitly reset it (set it to empty) in sddm.conf, then it will pick up the value from state.conf. Or explicitly set session you want in sddm.conf.

1 Like