fix wayland init and do setcap in docker build step

This commit is contained in:
thelamer 2026-01-04 17:52:16 -05:00
parent bfd1d80486
commit f083d35be4
No known key found for this signature in database
3 changed files with 44 additions and 13 deletions

View File

@ -8,7 +8,8 @@ LABEL maintainer="thelamer"
# title
ENV TITLE="Fedora KDE" \
NO_GAMEPAD=true
NO_GAMEPAD=true \
SELKIES_WAYLAND_SOCKET_INDEX=1
RUN \
echo "**** add icon ****" && \
@ -38,6 +39,17 @@ RUN \
sed -i \
's#^Exec=.*#Exec=/usr/local/bin/wrapped-chromium#g' \
/usr/share/applications/chromium-browser.desktop && \
setcap -r \
/usr/sbin/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 "**** kde tweaks ****" && \
sed -i \
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \

View File

@ -8,7 +8,8 @@ LABEL maintainer="thelamer"
# title
ENV TITLE="Fedora KDE" \
NO_GAMEPAD=true
NO_GAMEPAD=true \
SELKIES_WAYLAND_SOCKET_INDEX=1
RUN \
echo "**** add icon ****" && \
@ -38,6 +39,17 @@ RUN \
sed -i \
's#^Exec=.*#Exec=/usr/local/bin/wrapped-chromium#g' \
/usr/share/applications/chromium-browser.desktop && \
setcap -r \
/usr/sbin/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 "**** kde tweaks ****" && \
sed -i \
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \

View File

@ -52,18 +52,25 @@ sudo mv \
kbuildsycoca6
# Wayland Hacks
unset DISPLAY
sudo setcap -r /usr/sbin/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/
if ! grep -q "ozone-platform" /usr/local/bin/wrapped-chromium > /dev/null 2>&1; then
sudo sed -i 's/--password/--ozone-platform=wayland --password/g' /usr/local/bin/wrapped-chromium
fi
sudo rm -f /usr/share/applications/chromium-browser.desktop
# 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
# 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
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