In my setup I have 2 cases of this causing problems:
Autostarted Thunderbird failed because no $DISPLAY environment variable specified, but when started inside desktop session it can start fine
Autostarted Yakuake started fine, but doesnt have the above environment variable and I cannot really start any app that uses Xwayland, this problem goes away when yakuake restarted inside desktop session
The cause is probably that applications in .config/autostart/ are being launched before Plasma is ready, and there are a few environment variables that are still not set yet.
I tried switching to plasma-login-manager because I though maybe SDDM could be the culprit, but nothing changed.
I’m running on a Nvidia 4070 with proprietary drivers, installed using akmods.
I also have autologin enabled.
xwaylandvideobridge was crashing on boot for the same reason, I had to make a drop-in file for the systemd service, with a target further in the boot process:
[Unit]
After=plasma-kwin_wayland.service
Default is:
### /run/user/1000/systemd/generator.late/app-org.kde.xwaylandvideobridge@autostart.service
# # Automatically generated by systemd-xdg-autostart-generator
[Unit]
Documentation=man:systemd-xdg-autostart-generator(8)
SourcePath=/etc/xdg/autostart/org.kde.xwaylandvideobridge.desktop
PartOf=graphical-session.target
Description=Xwayland Video Bridge
After=graphical-session.target