Skip to content

Commit 9caa19d

Browse files
committed
#413 link xwayland socket properly for X11 apps arch
1 parent d8bb8ad commit 9caa19d

4 files changed

Lines changed: 31 additions & 11 deletions

File tree

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ RUN \
3838
/usr/share/applications/chromium.desktop && \
3939
setcap -r \
4040
/usr/sbin/kwin_wayland && \
41-
echo "**** kde tweaks ****" && \
42-
sed -i \
43-
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \
44-
/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
4541
echo "**** cleanup ****" && \
4642
rm -rf \
4743
/config/.cache \

Dockerfile.aarch64

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ RUN \
3838
/usr/share/applications/chromium.desktop && \
3939
setcap -r \
4040
/usr/sbin/kwin_wayland && \
41-
echo "**** kde tweaks ****" && \
42-
sed -i \
43-
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \
44-
/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
4541
echo "**** cleanup ****" && \
4642
rm -rf \
4743
/config/.cache \

root/defaults/startwm_wayland.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,17 @@ export QT_QPA_PLATFORM=wayland
9393
export XDG_CURRENT_DESKTOP=KDE
9494
export XDG_SESSION_TYPE=wayland
9595
export KDE_SESSION_VERSION=6
96-
unset DISPLAY
96+
export DISPLAY=:1
97+
sudo mkdir -p /tmp/.X11-unix
98+
sudo chmod 1777 /tmp/.X11-unix
9799
dbus-run-session bash -c '
98-
WAYLAND_DISPLAY=wayland-1 kwin_wayland --no-lockscreen &
100+
WAYLAND_DISPLAY=wayland-1 python3 /kwin-xwayland.py &
99101
KWIN_PID=$!
100102
sleep 2
101103
if [ -f /usr/lib/libexec/polkit-kde-authentication-agent-1 ]; then
102104
/usr/lib/libexec/polkit-kde-authentication-agent-1 &
103105
elif [ -f /usr/libexec/polkit-kde-authentication-agent-1 ]; then
104-
/usr/libexec/polkit-kde-authentication-agent-1
106+
/usr/libexec/polkit-kde-authentication-agent-1 &
105107
fi
106108
WAYLAND_DISPLAY=wayland-0 plasmashell
107109
kill $KWIN_PID

root/kwin-xwayland.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python3
2+
import socket
3+
import os
4+
5+
display_env = os.environ.get("DISPLAY", ":1")
6+
display_num = display_env.lstrip(":")
7+
path = f"/tmp/.X11-unix/X{display_num}"
8+
9+
if os.path.exists(path):
10+
os.remove(path)
11+
12+
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
13+
s.bind(path)
14+
s.listen(128)
15+
16+
fd = s.fileno()
17+
os.set_inheritable(fd, True)
18+
19+
os.execlp(
20+
"kwin_wayland",
21+
"kwin_wayland",
22+
"--no-lockscreen",
23+
"--xwayland",
24+
f"--xwayland-display=:{display_num}",
25+
f"--xwayland-fd={fd}"
26+
)

0 commit comments

Comments
 (0)