mirror of
https://github.com/linuxserver/docker-webtop.git
synced 2026-03-16 00:00:48 +08:00
fix wayland init and do setcap in docker build step
This commit is contained in:
parent
bfd1d80486
commit
f083d35be4
14
Dockerfile
14
Dockerfile
@ -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' \
|
||||
|
||||
@ -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' \
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user