diff --git a/startkde/startplasmacompositor.cmake b/startkde/startplasmacompositor.cmake --- a/startkde/startplasmacompositor.cmake +++ b/startkde/startplasmacompositor.cmake @@ -3,6 +3,19 @@ # DEFAULT Plasma STARTUP SCRIPT ( @PROJECT_VERSION@ ) # +# read in arguments to script +while [ $# -gt 0 ]; do + case "$1" in + --socket=*) + WAYLAND_SOCKET="${1#*=}" + ;; + *) + echo "Error: Invalid argument to startplasmacompositor script. Abort." + exit 1 + esac + shift +done + # We need to create config folder so we can write startupconfigkeys if [ ${XDG_CONFIG_HOME} ]; then configDir=$XDG_CONFIG_HOME; @@ -231,7 +244,15 @@ exit 1 fi -@KWIN_WAYLAND_BIN_PATH@ --xwayland --libinput --exit-with-session=@CMAKE_INSTALL_FULL_LIBEXECDIR@/startplasma + +if [ -z "$WAYLAND_SOCKET" ]; then + echo "Starting KWin as Wayland server on default Wayland socket."; + @KWIN_WAYLAND_BIN_PATH@ --xwayland --libinput --exit-with-session=@CMAKE_INSTALL_FULL_LIBEXECDIR@/startplasma +else + echo "Starting KWin as Wayland server on Wayland socket '$WAYLAND_SOCKET'."; + @KWIN_WAYLAND_BIN_PATH@ --xwayland --libinput --socket "$WAYLAND_SOCKET" --exit-with-session=@CMAKE_INSTALL_FULL_LIBEXECDIR@/startplasma +fi + echo 'startplasmacompositor: Shutting down...' 1>&2