Some display related environment variable are not passed to autostart app in Fedora KDE 44

,

I have this peculiar situation here where some display related environment are not passed to autostart app in KDE Plasma.

These includes but not limited to:

  • $DISPLAY
  • $WAYLAND_DISPLAY
  • $XAUTHORITY

and I think is related to https://discuss.kde.org/t/kde-wayland-startup-issues-cant-find-display-variable/2216/2

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

Is there a way to fix this?

I’m having the same issue.

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

Try adding a 5 second delay to the autostart files

X-GNOME-Autostart-Delay=5