From c51945138000a771eef0a48d32271b84a1fdaba2 Mon Sep 17 00:00:00 2001 From: thelamer Date: Sun, 4 Jan 2026 19:09:34 -0500 Subject: [PATCH] fix wayland init --- Dockerfile | 14 +++++++++++++- Dockerfile.aarch64 | 14 +++++++++++++- root/defaults/startwm_wayland.sh | 28 +++++++++++++++++----------- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index dc2c972..e7e3857 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,8 @@ LABEL maintainer="thelamer" # title ENV TITLE="Kali Linux" \ - NO_GAMEPAD=true + NO_GAMEPAD=true \ + SELKIES_WAYLAND_SOCKET_INDEX=1 RUN \ echo "**** add icon ****" && \ @@ -56,6 +57,17 @@ RUN \ sed -i \ 's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \ /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \ + setcap -r \ + /usr/bin/kwin_wayland && \ + rm -f \ + /usr/bin/wl-paste \ + /usr/bin/wl-copy && \ + echo "#! /bin/bash" > \ + /tmp/wl-paste && \ + echo "#! /bin/bash" > \ + /tmp/wl-copy && \ + chmod +x /tmp/wl-* && \ + cp /tmp/wl-* /usr/bin/ && \ echo "**** cleanup ****" && \ apt-get autoclean && \ rm -rf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index c35c3ec..2c3b45a 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -10,7 +10,8 @@ LABEL maintainer="thelamer" # title ENV TITLE="Kali Linux" \ - NO_GAMEPAD=true + NO_GAMEPAD=true \ + SELKIES_WAYLAND_SOCKET_INDEX=1 RUN \ echo "**** add icon ****" && \ @@ -56,6 +57,17 @@ RUN \ sed -i \ 's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \ /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \ + setcap -r \ + /usr/bin/kwin_wayland && \ + rm -f \ + /usr/bin/wl-paste \ + /usr/bin/wl-copy && \ + echo "#! /bin/bash" > \ + /tmp/wl-paste && \ + echo "#! /bin/bash" > \ + /tmp/wl-copy && \ + chmod +x /tmp/wl-* && \ + cp /tmp/wl-* /usr/bin/ && \ echo "**** cleanup ****" && \ apt-get autoclean && \ rm -rf \ diff --git a/root/defaults/startwm_wayland.sh b/root/defaults/startwm_wayland.sh index 81368fa..228f91e 100755 --- a/root/defaults/startwm_wayland.sh +++ b/root/defaults/startwm_wayland.sh @@ -48,15 +48,21 @@ sudo mv \ /etc/xdg/menus/applications.menu kbuildsycoca6 -# Wayland Hacks +# Export variables globally so all children inherit them +export QT_QPA_PLATFORM=wayland +export XDG_CURRENT_DESKTOP=KDE +export XDG_SESSION_TYPE=wayland +export KDE_SESSION_VERSION=6 unset DISPLAY -sudo setcap -r /usr/bin/kwin_wayland -sudo rm -f /usr/bin/wl-paste /usr/bin/wl-copy -echo "#! /bin/bash" > /tmp/wl-paste && chmod +x /tmp/wl-paste -echo "#! /bin/bash" > /tmp/wl-copy && chmod +x /tmp/wl-copy -sudo cp /tmp/wl-* /usr/bin/ - -# Start DE -WAYLAND_DISPLAY=wayland-1 dbus-run-session kwin_wayland & -sleep 2 -WAYLAND_DISPLAY=wayland-0 exec dbus-run-session /usr/bin/plasmashell > /dev/null 2>&1 +dbus-run-session bash -c ' + WAYLAND_DISPLAY=wayland-1 kwin_wayland --no-lockscreen & + KWIN_PID=$! + sleep 2 + if [ -f /usr/lib/libexec/polkit-kde-authentication-agent-1 ]; then + /usr/lib/libexec/polkit-kde-authentication-agent-1 & + elif [ -f /usr/libexec/polkit-kde-authentication-agent-1 ]; then + /usr/libexec/polkit-kde-authentication-agent-1 + fi + WAYLAND_DISPLAY=wayland-0 plasmashell + kill $KWIN_PID +' > /dev/null 2>&1