Skip to content

Commit a6bfdda

Browse files
authored
Ubuntu kde resolute (#409)
* rebase ubuntu-kde to resolute, force wayland as X11 is deprecated * do not apply clipboard fixes to arm * actually bump aarch64 to resolute
1 parent 2334be8 commit a6bfdda

4 files changed

Lines changed: 90 additions & 74 deletions

File tree

Dockerfile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/linuxserver/baseimage-selkies:ubuntunoble
1+
FROM ghcr.io/linuxserver/baseimage-selkies:ubunturesolute
22

33
# set version label
44
ARG BUILD_DATE
@@ -9,7 +9,8 @@ ARG DEBIAN_FRONTEND="noninteractive"
99

1010
# title
1111
ENV TITLE="Ubuntu KDE" \
12-
NO_GAMEPAD=true
12+
NO_GAMEPAD=true \
13+
PIXELFLUX_WAYLAND=true
1314

1415
RUN \
1516
echo "**** add icon ****" && \
@@ -21,6 +22,7 @@ RUN \
2122
apt-get update && \
2223
DEBIAN_FRONTEND=noninteractive \
2324
apt-get install --no-install-recommends -y \
25+
cargo \
2426
chromium \
2527
dolphin \
2628
gwenview \
@@ -34,26 +36,31 @@ RUN \
3436
ksystemstats \
3537
kubuntu-settings-desktop \
3638
kubuntu-wallpapers \
37-
kubuntu-web-shortcuts \
3839
kwin-addons \
3940
kwin-x11 \
4041
kwrite \
4142
plasma-desktop \
4243
plasma-workspace \
4344
qml-module-qt-labs-platform \
4445
systemsettings && \
46+
cargo install \
47+
wl-clipboard-rs-tools && \
48+
echo "**** replace wl-clipboard with rust ****" && \
49+
mv \
50+
/config/.cargo/bin/wl-* \
51+
/usr/bin/ && \
4552
echo "**** application tweaks ****" && \
4653
sed -i \
4754
's#^Exec=.*#Exec=/usr/local/bin/wrapped-chromium#g' \
4855
/usr/share/applications/chromium.desktop && \
4956
echo "**** kde tweaks ****" && \
50-
sed -i \
51-
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \
52-
/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
57+
setcap -r \
58+
/usr/bin/kwin_wayland && \
5359
echo "**** cleanup ****" && \
5460
apt-get autoclean && \
5561
rm -rf \
5662
/config/.cache \
63+
/config/.cargo \
5764
/config/.launchpadlib \
5865
/var/lib/apt/lists/* \
5966
/var/tmp/* \
@@ -63,5 +70,5 @@ RUN \
6370
COPY /root /
6471

6572
# ports and volumes
66-
EXPOSE 3000
73+
EXPOSE 3001
6774
VOLUME /config

Dockerfile.aarch64

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/linuxserver/baseimage-selkies:arm64v8-ubuntunoble
1+
FROM ghcr.io/linuxserver/baseimage-selkies:arm64v8-ubunturesolute
22

33
# set version label
44
ARG BUILD_DATE
@@ -9,7 +9,8 @@ ARG DEBIAN_FRONTEND="noninteractive"
99

1010
# title
1111
ENV TITLE="Ubuntu KDE" \
12-
NO_GAMEPAD=true
12+
NO_GAMEPAD=true \
13+
PIXELFLUX_WAYLAND=true
1314

1415
RUN \
1516
echo "**** add icon ****" && \
@@ -21,6 +22,7 @@ RUN \
2122
apt-get update && \
2223
DEBIAN_FRONTEND=noninteractive \
2324
apt-get install --no-install-recommends -y \
25+
cargo \
2426
chromium \
2527
dolphin \
2628
gwenview \
@@ -34,26 +36,31 @@ RUN \
3436
ksystemstats \
3537
kubuntu-settings-desktop \
3638
kubuntu-wallpapers \
37-
kubuntu-web-shortcuts \
3839
kwin-addons \
3940
kwin-x11 \
4041
kwrite \
4142
plasma-desktop \
4243
plasma-workspace \
4344
qml-module-qt-labs-platform \
4445
systemsettings && \
46+
cargo install \
47+
wl-clipboard-rs-tools && \
48+
echo "**** replace wl-clipboard with rust ****" && \
49+
mv \
50+
/config/.cargo/bin/wl-* \
51+
/usr/bin/ && \
4552
echo "**** application tweaks ****" && \
4653
sed -i \
4754
's#^Exec=.*#Exec=/usr/local/bin/wrapped-chromium#g' \
4855
/usr/share/applications/chromium.desktop && \
4956
echo "**** kde tweaks ****" && \
50-
sed -i \
51-
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \
52-
/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
57+
setcap -r \
58+
/usr/bin/kwin_wayland && \
5359
echo "**** cleanup ****" && \
5460
apt-get autoclean && \
5561
rm -rf \
5662
/config/.cache \
63+
/config/.cargo \
5764
/config/.launchpadlib \
5865
/var/lib/apt/lists/* \
5966
/var/tmp/* \
@@ -63,5 +70,5 @@ RUN \
6370
COPY /root /
6471

6572
# ports and volumes
66-
EXPOSE 3000
73+
EXPOSE 3001
6774
VOLUME /config

root/defaults/startwm.sh

Lines changed: 0 additions & 53 deletions
This file was deleted.

root/defaults/startwm_wayland.sh

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,50 @@
11
#!/bin/bash
2+
ulimit -c 0
23

3-
# Disable compositing and screen lock
4+
# Disable compositing and screen locking
45
if [ ! -f $HOME/.config/kwinrc ]; then
5-
kwriteconfig5 --file $HOME/.config/kwinrc --group Compositing --key Enabled false
6+
kwriteconfig6 --file $HOME/.config/kwinrc --group Compositing --key Enabled false
67
fi
78
if [ ! -f $HOME/.config/kscreenlockerrc ]; then
8-
kwriteconfig5 --file $HOME/.config/kscreenlockerrc --group Daemon --key Autolock false
9+
kwriteconfig6 --file $HOME/.config/kscreenlockerrc --group Daemon --key Autolock false
910
fi
1011

1112
# Power related
1213
setterm blank 0
1314
setterm powerdown 0
1415

16+
# Setup permissive clipboard rules
17+
KWIN_RULES_FILE="$HOME/.config/kwinrulesrc"
18+
RULE_DESC="wl-clipboard support"
19+
if ! grep -q "$RULE_DESC" "$KWIN_RULES_FILE" 2>/dev/null; then
20+
echo "Applying KWin clipboard rule..."
21+
if command -v uuidgen &> /dev/null; then
22+
RULE_ID=$(uuidgen)
23+
else
24+
RULE_ID=$(cat /proc/sys/kernel/random/uuid)
25+
fi
26+
count=$(kreadconfig6 --file "$KWIN_RULES_FILE" --group General --key count --default 0)
27+
new_count=$((count + 1))
28+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group General --key count "$new_count"
29+
existing_rules=$(kreadconfig6 --file "$KWIN_RULES_FILE" --group General --key rules)
30+
if [ -z "$existing_rules" ]; then
31+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group General --key rules "$RULE_ID"
32+
else
33+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group General --key rules "$existing_rules,$RULE_ID"
34+
fi
35+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key Description "$RULE_DESC"
36+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key wmclass "wl-(copy|paste)"
37+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key wmclassmatch 3
38+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key skiptaskbar --type bool "true"
39+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key skiptaskbarrule 2
40+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key skipswitcher --type bool "true"
41+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key skipswitcherrule 2
42+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key fsplevel 3
43+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key fsplevelrule 2
44+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key noborder --type bool "true"
45+
kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key noborderrule 2
46+
fi
47+
1548
# Directories
1649
sudo rm -f /usr/share/dbus-1/system-services/org.freedesktop.UDisks2.service
1750
mkdir -p "${HOME}/.config/autostart" "${HOME}/.XDG" "${HOME}/.local/share/"
@@ -42,7 +75,29 @@ if [ ! -f "${STARTUP_FILE}" ]; then
4275
chmod +x $STARTUP_FILE
4376
fi
4477

45-
# Start DE
46-
WAYLAND_DISPLAY=wayland-1 Xwayland :1 &
47-
sleep 2
48-
exec dbus-launch --exit-with-session /usr/bin/startplasma-x11 > /dev/null 2>&1
78+
# Setup application DB
79+
if [ ! -f "/etc/xdg/menus/applications.menu" ]; then
80+
sudo mv \
81+
/etc/xdg/menus/plasma-applications.menu \
82+
/etc/xdg/menus/applications.menu
83+
fi
84+
kbuildsycoca6
85+
86+
# Export variables globally so all children inherit them
87+
export QT_QPA_PLATFORM=wayland
88+
export XDG_CURRENT_DESKTOP=KDE
89+
export XDG_SESSION_TYPE=wayland
90+
export KDE_SESSION_VERSION=6
91+
unset DISPLAY
92+
dbus-run-session bash -c '
93+
WAYLAND_DISPLAY=wayland-1 kwin_wayland --no-lockscreen &
94+
KWIN_PID=$!
95+
sleep 2
96+
if [ -f /usr/lib/libexec/polkit-kde-authentication-agent-1 ]; then
97+
/usr/lib/libexec/polkit-kde-authentication-agent-1 &
98+
elif [ -f /usr/libexec/polkit-kde-authentication-agent-1 ]; then
99+
/usr/libexec/polkit-kde-authentication-agent-1
100+
fi
101+
WAYLAND_DISPLAY=wayland-0 plasmashell
102+
kill $KWIN_PID
103+
' > /dev/null 2>&1

0 commit comments

Comments
 (0)