aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan de Groot <adridg@FreeBSD.org>2021-04-30 15:06:08 +0000
committerAdriaan de Groot <adridg@FreeBSD.org>2021-04-30 15:29:36 +0000
commit7dbd17a38d01f5f027e16ec8a77565d6822320db (patch)
tree35582e84f0ccd0a3606127cfcb4bd6c5573f83c8
parentba447816c037c00e0540fa28678f860e4175bd67 (diff)
downloadports-7dbd17a38d01f5f027e16ec8a77565d6822320db.tar.gz
ports-7dbd17a38d01f5f027e16ec8a77565d6822320db.zip
x11/plasma5-plasma-workspace: add helper script for Plasma Wayland
There are a handful of environment variables that need to be set for a KDE Plasma Wayland session. In addition, it needs a ConsoleKit session and its own session DBus. Add a suitable shell script that can live alongside the regular executable. Note that the .desktop file for Plasma does **not** use this script -- but then again, SDDM doesn't hand off to Wayland nicely either, so you need to start Plasma Wayland from a text console anyway. That's simple enough now: `startplasma-wayland.sh`
-rw-r--r--x11/plasma5-plasma-workspace/Makefile5
-rwxr-xr-xx11/plasma5-plasma-workspace/files/startplasma-wayland.sh61
-rw-r--r--x11/plasma5-plasma-workspace/pkg-plist1
3 files changed, 66 insertions, 1 deletions
diff --git a/x11/plasma5-plasma-workspace/Makefile b/x11/plasma5-plasma-workspace/Makefile
index 5e1f510cf9c3..fbaacd9b9af0 100644
--- a/x11/plasma5-plasma-workspace/Makefile
+++ b/x11/plasma5-plasma-workspace/Makefile
@@ -1,6 +1,6 @@
PORTNAME= plasma-workspace
DISTVERSION= ${KDE_PLASMA_VERSION}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11 kde kde-plasma
MAINTAINER= kde@FreeBSD.org
@@ -51,4 +51,7 @@ CMAKE_OFF= BUILD_TESTING
# In 5.15 a file was moved from x11/plasma5-plasma-desktop to x11/plasma5-plasma-workspace:
CONFLICTS_INSTALL= plasma5-plasma-desktop-5.14.*
+post-stage:
+ ${INSTALL_SCRIPT} ${FILESDIR}/startplasma-wayland.sh ${STAGEDIR}/${LOCALBASE}/bin/
+
.include <bsd.port.mk>
diff --git a/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh b/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh
new file mode 100755
index 000000000000..cfd30dacc18a
--- /dev/null
+++ b/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh
@@ -0,0 +1,61 @@
+#! /bin/sh
+#
+# Try to run a Plasma Wayland session; to be invoked from a text console
+
+### TOOLKIT SETTINGS
+#
+# Tell toolkits to use wayland
+export MOZ_ENABLE_WAYLAND=1
+export GDK_BACKEND=wayland
+export QT_QPA_PLATFORM=wayland-egl
+export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
+
+# Possible settings for drivers
+#
+# Some (older) Intel HD iGPU need this:
+# export LIBVA_DRIVER_NAME=i965
+
+### XDG SETTINGS
+#
+#
+if test -z "$XDG_RUNTIME_DIR"; then
+ export XDG_RUNTIME_DIR=/tmp/`id -u`-runtime-dir
+ if ! test -d "$XDG_RUNTIME_DIR"; then
+ mkdir "$XDG_RUNTIME_DIR"
+ chmod 0700 "$XDG_RUNTIME_DIR"
+ fi
+fi
+export XDG_SESSION_TYPE=wayland
+
+### KDE / Plasma / Qt settings
+#
+#
+# To switch on software rendering:
+# export KWIN_COMPOSE=Q
+# To log debug things:
+# export QT_LOGGING_RULES="kwin_core.debug=true;kwin_libinput.debug=true"
+# To log to a specific file (recommended if you're using the logging rules
+# and want to debug startup problems):
+# LOGFILE=/tmp/plasma-wayland.log
+
+# TODO: check if ck-launch-session is needed
+scaffolding="ck-launch-session"
+if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] ; then
+ scaffolding="$scaffolding dbus-run-session"
+fi
+
+startup_dir=`/usr/bin/dirname "$0"`
+startup_exe=`/usr/bin/basename "$0" .sh`
+
+if [ -z "$LOGFILE" ] ; then
+ {
+ echo "Starting KDE Plasma Wayland from PID $$"
+ echo "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR"
+ echo "scaffolding=$scaffolding"
+ echo "startup=$startup_dir/$startup_exe"
+ } > $LOGFILE
+
+ exec $scaffolding $startup_dir/$startup_exe 2>&1 | tee -a $LOG
+else
+ exec $scaffolding $startup_dir/$startup_exe
+fi
diff --git a/x11/plasma5-plasma-workspace/pkg-plist b/x11/plasma5-plasma-workspace/pkg-plist
index 176f7123e8de..cffdc489c379 100644
--- a/x11/plasma5-plasma-workspace/pkg-plist
+++ b/x11/plasma5-plasma-workspace/pkg-plist
@@ -16,6 +16,7 @@ bin/plasma_waitforname
bin/plasmashell
bin/plasmawindowed
bin/startplasma-wayland
+bin/startplasma-wayland.sh
bin/startplasma-x11
bin/systemmonitor
bin/xembedsniproxy