Skip to content

Commit b5cddab

Browse files
committed
clipboard suppord wayland arch kde
1 parent 226fb19 commit b5cddab

3 files changed

Lines changed: 55 additions & 25 deletions

File tree

Dockerfile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ LABEL maintainer="thelamer"
88

99
# title
1010
ENV TITLE="Arch KDE" \
11-
NO_GAMEPAD=true \
12-
SELKIES_WAYLAND_SOCKET_INDEX=1
11+
NO_GAMEPAD=true
1312

1413
RUN \
1514
echo "**** add icon ****" && \
@@ -18,6 +17,7 @@ RUN \
1817
https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/webtop-logo.png && \
1918
echo "**** install packages ****" && \
2019
pacman -Sy --noconfirm --needed \
20+
cargo \
2121
chromium \
2222
dolphin \
2323
firefox \
@@ -26,28 +26,26 @@ RUN \
2626
kwin-x11 \
2727
plasma-desktop \
2828
plasma-x11-session && \
29+
cargo install \
30+
wl-clipboard-rs-tools && \
31+
echo "**** replace wl-clipboard with rust ****" && \
32+
mv \
33+
/config/.cargo/bin/wl-* \
34+
/usr/bin/ && \
2935
echo "**** application tweaks ****" && \
3036
sed -i \
3137
's#^Exec=.*#Exec=/usr/local/bin/wrapped-chromium#g' \
3238
/usr/share/applications/chromium.desktop && \
3339
setcap -r \
3440
/usr/sbin/kwin_wayland && \
35-
rm -f \
36-
/usr/bin/wl-paste \
37-
/usr/bin/wl-copy && \
38-
echo "#! /bin/bash" > \
39-
/tmp/wl-paste && \
40-
echo "#! /bin/bash" > \
41-
/tmp/wl-copy && \
42-
chmod +x /tmp/wl-* && \
43-
cp /tmp/wl-* /usr/bin/ && \
4441
echo "**** kde tweaks ****" && \
4542
sed -i \
4643
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \
4744
/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
4845
echo "**** cleanup ****" && \
4946
rm -rf \
5047
/config/.cache \
48+
/config/.cargo \
5149
/tmp/* \
5250
/var/cache/pacman/pkg/* \
5351
/var/lib/pacman/sync/*

Dockerfile.aarch64

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ LABEL maintainer="thelamer"
88

99
# title
1010
ENV TITLE="Arch KDE" \
11-
NO_GAMEPAD=true \
12-
SELKIES_WAYLAND_SOCKET_INDEX=1
11+
NO_GAMEPAD=true
1312

1413
RUN \
1514
echo "**** add icon ****" && \
@@ -18,6 +17,7 @@ RUN \
1817
https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/webtop-logo.png && \
1918
echo "**** install packages ****" && \
2019
pacman -Sy --noconfirm --needed \
20+
cargo \
2121
chromium \
2222
dolphin \
2323
firefox \
@@ -26,28 +26,26 @@ RUN \
2626
kwin-x11 \
2727
plasma-desktop \
2828
plasma-x11-session && \
29+
cargo install \
30+
wl-clipboard-rs-tools && \
31+
echo "**** replace wl-clipboard with rust ****" && \
32+
mv \
33+
/config/.cargo/bin/wl-* \
34+
/usr/bin/ && \
2935
echo "**** application tweaks ****" && \
3036
sed -i \
3137
's#^Exec=.*#Exec=/usr/local/bin/wrapped-chromium#g' \
3238
/usr/share/applications/chromium.desktop && \
3339
setcap -r \
3440
/usr/sbin/kwin_wayland && \
35-
rm -f \
36-
/usr/bin/wl-paste \
37-
/usr/bin/wl-copy && \
38-
echo "#! /bin/bash" > \
39-
/tmp/wl-paste && \
40-
echo "#! /bin/bash" > \
41-
/tmp/wl-copy && \
42-
chmod +x /tmp/wl-* && \
43-
cp /tmp/wl-* /usr/bin/ && \
4441
echo "**** kde tweaks ****" && \
4542
sed -i \
4643
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \
4744
/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
4845
echo "**** cleanup ****" && \
4946
rm -rf \
5047
/config/.cache \
48+
/config/.cargo \
5149
/tmp/* \
5250
/var/cache/pacman/pkg/* \
5351
/var/lib/pacman/sync/*

root/defaults/startwm_wayland.sh

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,38 @@ fi
1212
setterm blank 0
1313
setterm powerdown 0
1414

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

4577
# Setup application DB
46-
sudo mv \
47-
/etc/xdg/menus/plasma-applications.menu \
48-
/etc/xdg/menus/applications.menu
78+
if [ ! -f "/etc/xdg/menus/applications.menu" ]; then
79+
sudo mv \
80+
/etc/xdg/menus/plasma-applications.menu \
81+
/etc/xdg/menus/applications.menu
82+
fi
4983
kbuildsycoca6
5084

5185
# Wayland Hacks

0 commit comments

Comments
 (0)