Skip to content

Commit 614581a

Browse files
committed
add wayland clipboard support
1 parent 4b5634a commit 614581a

File tree

3 files changed

+55
-25
lines changed

3 files changed

+55
-25
lines changed

Dockerfile

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

1111
# title
1212
ENV TITLE="Kali Linux" \
13-
NO_GAMEPAD=true \
14-
SELKIES_WAYLAND_SOCKET_INDEX=1
13+
NO_GAMEPAD=true
1514

1615
RUN \
1716
echo "**** add icon ****" && \
@@ -23,6 +22,7 @@ RUN \
2322
DEBIAN_FRONTEND=noninteractive \
2423
apt-get install -y --no-install-recommends \
2524
autopsy \
25+
cargo \
2626
cutycapt \
2727
dirbuster \
2828
dolphin \
@@ -53,25 +53,23 @@ RUN \
5353
qt6-svg-plugins \
5454
sqlitebrowser \
5555
systemsettings && \
56+
cargo install \
57+
wl-clipboard-rs-tools && \
58+
echo "**** replace wl-clipboard with rust ****" && \
59+
mv \
60+
/config/.cargo/bin/wl-* \
61+
/usr/bin/ && \
5662
echo "**** kde tweaks ****" && \
5763
sed -i \
5864
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \
5965
/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
6066
setcap -r \
6167
/usr/bin/kwin_wayland && \
62-
rm -f \
63-
/usr/bin/wl-paste \
64-
/usr/bin/wl-copy && \
65-
echo "#! /bin/bash" > \
66-
/tmp/wl-paste && \
67-
echo "#! /bin/bash" > \
68-
/tmp/wl-copy && \
69-
chmod +x /tmp/wl-* && \
70-
cp /tmp/wl-* /usr/bin/ && \
7168
echo "**** cleanup ****" && \
7269
apt-get autoclean && \
7370
rm -rf \
7471
/config/.cache \
72+
/config/.cargo \
7573
/var/lib/apt/lists/* \
7674
/var/tmp/* \
7775
/tmp/*

Dockerfile.aarch64

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

1111
# title
1212
ENV TITLE="Kali Linux" \
13-
NO_GAMEPAD=true \
14-
SELKIES_WAYLAND_SOCKET_INDEX=1
13+
NO_GAMEPAD=true
1514

1615
RUN \
1716
echo "**** add icon ****" && \
@@ -23,6 +22,7 @@ RUN \
2322
DEBIAN_FRONTEND=noninteractive \
2423
apt-get install -y --no-install-recommends \
2524
autopsy \
25+
cargo \
2626
cutycapt \
2727
dirbuster \
2828
dolphin \
@@ -53,25 +53,23 @@ RUN \
5353
qt6-svg-plugins \
5454
sqlitebrowser \
5555
systemsettings && \
56+
cargo install \
57+
wl-clipboard-rs-tools && \
58+
echo "**** replace wl-clipboard with rust ****" && \
59+
mv \
60+
/config/.cargo/bin/wl-* \
61+
/usr/bin/ && \
5662
echo "**** kde tweaks ****" && \
5763
sed -i \
5864
's/applications:org.kde.discover.desktop,/applications:org.kde.konsole.desktop,/g' \
5965
/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
6066
setcap -r \
6167
/usr/bin/kwin_wayland && \
62-
rm -f \
63-
/usr/bin/wl-paste \
64-
/usr/bin/wl-copy && \
65-
echo "#! /bin/bash" > \
66-
/tmp/wl-paste && \
67-
echo "#! /bin/bash" > \
68-
/tmp/wl-copy && \
69-
chmod +x /tmp/wl-* && \
70-
cp /tmp/wl-* /usr/bin/ && \
7168
echo "**** cleanup ****" && \
7269
apt-get autoclean && \
7370
rm -rf \
7471
/config/.cache \
72+
/config/.cargo \
7573
/var/lib/apt/lists/* \
7674
/var/tmp/* \
7775
/tmp/*

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
# Export variables globally so all children inherit them

0 commit comments

Comments
 (0)