#!/bin/sh
# LinuxDoors wrapper -- see /etc/xdg/plasma-workspace/env/10-linuxdoors-paths.sh
export QT_PLUGIN_PATH="/usr/lib/plugins:/opt/qt6-full/plugins${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}"
export QML2_IMPORT_PATH="/usr/lib/qml:/opt/qt6-full/qml${QML2_IMPORT_PATH:+:$QML2_IMPORT_PATH}"
export QML_IMPORT_PATH="/usr/lib/qml:/opt/qt6-full/qml${QML_IMPORT_PATH:+:$QML_IMPORT_PATH}"
[ -z "$PLASMA_USE_SYSTEMD" ] && export PLASMA_USE_SYSTEMD=false
# kio's SystemdProcessRunner::calculateLaunchMode() makes a synchronous,
# blocking D-Bus call to org.freedesktop.systemd1 on every KIO-based app
# launch (desktop-icon double-clicks go through this; panel launchers
# don't, which is why only desktop icons showed the delay) -- with no
# systemd --user session (PLASMA_USE_SYSTEMD=false above), that call
# always fails, and waiting for it to time out is the real cause of the
# reported multi-second-to-minutes desktop-icon-open delay. This env var
# is KIO's own built-in override to skip that call entirely.
[ -z "$_KDE_APPLICATIONS_AS_FORKING" ] && export _KDE_APPLICATIONS_AS_FORKING=1
# The themed Breeze lock screen's clock->login reveal loses the password
# field's Qt active focus on this build (reproduced both over x2go/nxagent and
# on a real X11 console session) -- use the simple built-in locker always
# (handled in kscreenlocker via this env var).
export KSCREENLOCKER_SIMPLE_GREETER=1
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && command -v dbus-run-session >/dev/null 2>&1; then
    exec dbus-run-session -- /usr/bin/startplasma-x11.real "$@"
fi
exec /usr/bin/startplasma-x11.real "$@"
