Index: data/scripts/Xsession
--- data/scripts/Xsession.orig
+++ data/scripts/Xsession
@@ -8,6 +8,9 @@
 # Import the login environment for some shells by starting them as login shell
 # and executing this script. Inside, SDDM_XSESSION_PROFILE_READ will be set and
 # it continues below.
+
+PATH="/usr/X11R6/bin:/bin:/sbin:$PATH"
+
 if [ -z "$SDDM_XSESSION_PROFILE_READ" ]; then
   export SDDM_XSESSION_PROFILE_READ=1
 
@@ -87,7 +90,33 @@ if [ -z "$*" ]; then
     exit 1
 fi
 
+if [[ $@ == *startplasma-x11* ]]; then
+    # DEBUG
+    #export QT_LOGGING_RULES="*=true"
+
+    #export QT_DEBUG_PLUGINS=0
+    # https://userbase.kde.org/KDE_System_Administration/Environment_Variables
+
+    #export QT_LOGGING_RULES="*kwin*=true"
+    export KWIN_SCREENSHOT_NO_PERMISSION_CHECKS=1
+    #export QT_FORCE_STDERR_LOGGING=1
+    export QML_DISABLE_DISK_CACHE=1
+
+    export XDG_RUNTIME_DIR=$(mktemp -d /tmp/"$USER"-runtime-XXXXXX)
+    if [ ! -d $XDG_RUNTIME_DIR ]; then
+        export XDG_RUNTIME_DIR=/tmp/run/$(id -u)
+        mkdir -m 700 -p $XDG_RUNTIME_DIR
+    fi
+
+    if [ -x /usr/local/bin/dbus-launch -a -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
+        eval $(dbus-launch --sh-syntax --exit-with-x11)
+    fi
+
+    /usr/local/bin/ck-launch-session "$@"
+    exit 1
+fi
+
 # Note: This script is called with the whole session commandline as a single first argument.
 # To run it properly, word splitting has to be performed by the shell, i.e. $@ or $0 without quotes.
-exec $@
+exec ${LOCALBASE}/bin/dbus-launch --exit-with-x11 -- $STARTUP "$@"
 exit 1
