From 8405c506930ce35e42deba8e763cc52cdc231dc5 Mon Sep 17 00:00:00 2001 From: thelamer Date: Mon, 5 Jan 2026 16:47:12 -0500 Subject: [PATCH] clipboard support fedora kde wayland --- Dockerfile | 20 +++++++--------- Dockerfile.aarch64 | 20 +++++++--------- root/defaults/startwm_wayland.sh | 40 +++++++++++++++++++++++++++++--- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7480242..21e6ce72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,7 @@ LABEL maintainer="thelamer" # title ENV TITLE="Fedora KDE" \ - NO_GAMEPAD=true \ - SELKIES_WAYLAND_SOCKET_INDEX=1 + NO_GAMEPAD=true RUN \ echo "**** add icon ****" && \ @@ -19,6 +18,7 @@ RUN \ echo "**** install packages ****" && \ dnf install -y --setopt=install_weak_deps=False --best \ breeze-icon-theme \ + cargo \ chromium \ dolphin \ firefox \ @@ -35,21 +35,18 @@ RUN \ plasma-systemmonitor \ plasma-workspace-xorg \ qt5-qtscript && \ + cargo install \ + wl-clipboard-rs-tools && \ + echo "**** replace wl-clipboard with rust ****" && \ + mv \ + /config/.cargo/bin/wl-* \ + /usr/bin/ && \ echo "**** application tweaks ****" && \ 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' \ @@ -63,6 +60,7 @@ RUN \ dnf autoremove -y && \ dnf clean all && \ rm -rf \ + /config/.cargo \ /config/.cache \ /tmp/* diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 71b5139c..7ff04f3b 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -8,8 +8,7 @@ LABEL maintainer="thelamer" # title ENV TITLE="Fedora KDE" \ - NO_GAMEPAD=true \ - SELKIES_WAYLAND_SOCKET_INDEX=1 + NO_GAMEPAD=true RUN \ echo "**** add icon ****" && \ @@ -19,6 +18,7 @@ RUN \ echo "**** install packages ****" && \ dnf install -y --setopt=install_weak_deps=False --best \ breeze-icon-theme \ + cargo \ chromium \ dolphin \ firefox \ @@ -35,21 +35,18 @@ RUN \ plasma-systemmonitor \ plasma-workspace-xorg \ qt5-qtscript && \ + cargo install \ + wl-clipboard-rs-tools && \ + echo "**** replace wl-clipboard with rust ****" && \ + mv \ + /config/.cargo/bin/wl-* \ + /usr/bin/ && \ echo "**** application tweaks ****" && \ 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' \ @@ -63,6 +60,7 @@ RUN \ dnf autoremove -y && \ dnf clean all && \ rm -rf \ + /config/.cargo \ /config/.cache \ /tmp/* diff --git a/root/defaults/startwm_wayland.sh b/root/defaults/startwm_wayland.sh index 72ad9f5d..2181dec2 100755 --- a/root/defaults/startwm_wayland.sh +++ b/root/defaults/startwm_wayland.sh @@ -11,6 +11,38 @@ if [ ! -f $HOME/.config/kdeglobals ]; then kwriteconfig6 --file $HOME/.config/kdeglobals --group KDE --key LookAndFeelPackage org.fedoraproject.fedora.desktop fi +# Setup permissive clipboard rules +KWIN_RULES_FILE="$HOME/.config/kwinrulesrc" +RULE_DESC="wl-clipboard support" +if ! grep -q "$RULE_DESC" "$KWIN_RULES_FILE" 2>/dev/null; then + echo "Applying KWin clipboard rule..." + if command -v uuidgen &> /dev/null; then + RULE_ID=$(uuidgen) + else + RULE_ID=$(cat /proc/sys/kernel/random/uuid) + fi + count=$(kreadconfig6 --file "$KWIN_RULES_FILE" --group General --key count --default 0) + new_count=$((count + 1)) + kwriteconfig6 --file "$KWIN_RULES_FILE" --group General --key count "$new_count" + existing_rules=$(kreadconfig6 --file "$KWIN_RULES_FILE" --group General --key rules) + if [ -z "$existing_rules" ]; then + kwriteconfig6 --file "$KWIN_RULES_FILE" --group General --key rules "$RULE_ID" + else + kwriteconfig6 --file "$KWIN_RULES_FILE" --group General --key rules "$existing_rules,$RULE_ID" + fi + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key Description "$RULE_DESC" + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key wmclass "wl-(copy|paste)" + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key wmclassmatch 3 + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key skiptaskbar --type bool "true" + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key skiptaskbarrule 2 + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key skipswitcher --type bool "true" + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key skipswitcherrule 2 + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key fsplevel 3 + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key fsplevelrule 2 + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key noborder --type bool "true" + kwriteconfig6 --file "$KWIN_RULES_FILE" --group "$RULE_ID" --key noborderrule 2 +fi + # Power related setterm blank 0 setterm powerdown 0 @@ -46,9 +78,11 @@ if [ ! -f "${STARTUP_FILE}" ]; then fi # Setup application DB -sudo mv \ - /etc/xdg/menus/plasma-applications.menu \ - /etc/xdg/menus/applications.menu +if [ ! -f "/etc/xdg/menus/applications.menu" ]; then + sudo mv \ + /etc/xdg/menus/plasma-applications.menu \ + /etc/xdg/menus/applications.menu +fi kbuildsycoca6 # Wayland Hacks