clipboard support fedora kde wayland

This commit is contained in:
thelamer 2026-01-05 16:47:12 -05:00
parent c574dc1cf6
commit 8405c50693
No known key found for this signature in database
3 changed files with 55 additions and 25 deletions

View File

@ -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/*

View File

@ -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/*

View File

@ -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