chore(kde): Switch to using a shim to handle quirks w/ Prompt on KDE

This commit is contained in:
Kyle Gospodnetich 2024-01-09 01:25:47 -08:00
parent 04b769f87c
commit 0998bda759
2 changed files with 15 additions and 3 deletions

View File

@ -328,10 +328,10 @@ RUN if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
rm -rf /tmp/kwin-system76-scheduler-integration && \
rm -rf /tmp/wallpaper-engine-kde-plugin && \
sed -i '/<entry name="launchers" type="StringList">/,/<\/entry>/ s/<default>[^<]*<\/default>/<default>preferred:\/\/browser,applications:steam.desktop,applications:net.lutris.Lutris.desktop,applications:org.gnome.Prompt.desktop,applications:org.kde.discover.desktop,preferred:\/\/filemanager<\/default>/' /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/org.kde.konsole.desktop && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nX-KDE-AuthorizeAction=shell_access\nX-KDE-Shortcuts=Ctrl+Alt+T@g' /usr/share/applications/org.gnome.Prompt.desktop && \
sed -i 's/^Exec=prompt$/Exec=prompt --new-window/' /usr/share/applications/org.gnome.Prompt.desktop && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nX-KDE-Shortcuts=Ctrl+Alt+T@g' /usr/share/applications/org.gnome.Prompt.desktop && \
sed -i 's@Exec=prompt@Exec=kde-prompt@g' /usr/share/applications/org.gnome.Prompt.desktop && \
cp /usr/share/applications/org.gnome.Prompt.desktop /usr/share/kglobalaccel/org.gnome.Prompt.desktop && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/org.kde.konsole.desktop && \
rm -f /usr/share/kglobalaccel/org.kde.konsole.desktop \
; else \
rpm-ostree override replace \

View File

@ -0,0 +1,12 @@
#!/usr/bin/bash
# Shim to handle KDE only supporting -e
# https://bugs.kde.org/show_bug.cgi?id=459616
args=("${@//-e/--}")
# Dolphin integration requires --new-window to function properly
unshift() { local -n ary=$1; shift; ary=("$@" "${ary[@]}"); }
if [[ ! "${args[@]}" =~ "--" && ! "${args[@]}" =~ "-h" && ! "${args[@]}" =~ "-x" ]]; then
unshift args "--new-window"
fi
/usr/bin/prompt "${args[@]}"