From 8c7227a563f8612e542b1c7aece5028b055660c5 Mon Sep 17 00:00:00 2001 From: Yurii <34232854+Yurii-huang@users.noreply.github.com> Date: Thu, 19 Mar 2026 20:08:34 +0800 Subject: [PATCH] fix: deepin-os can't launch app with desktop file (#6555) * fix: deepin-os can't launch app with desktop file * fix: deepin-os move desktop to clash-verge.desktop --------- Co-authored-by: Yurii.Huang --- src-tauri/packages/linux/post-install.sh | 13 +++++++++++++ src-tauri/packages/linux/pre-remove.sh | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/src-tauri/packages/linux/post-install.sh b/src-tauri/packages/linux/post-install.sh index e3e75bafa..25fcf528d 100644 --- a/src-tauri/packages/linux/post-install.sh +++ b/src-tauri/packages/linux/post-install.sh @@ -2,3 +2,16 @@ chmod +x /usr/bin/clash-verge-service-install chmod +x /usr/bin/clash-verge-service-uninstall chmod +x /usr/bin/clash-verge-service + +. /etc/os-release + +if [ "$ID" = "deepin" ]; then + PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE" + DESKTOP_FILES=$(dpkg -L "$PACKAGE_NAME" 2>/dev/null | grep "\.desktop$") + echo "$DESKTOP_FILES" | while IFS= read -r f; do + if [ "$(basename "$f")" == "Clash Verge.desktop" ]; then + echo "Fixing deepin desktop file" + mv -vf "$f" "/usr/share/applications/clash-verge.desktop" + fi + done +fi diff --git a/src-tauri/packages/linux/pre-remove.sh b/src-tauri/packages/linux/pre-remove.sh index 481a47f6e..e12e68d3e 100644 --- a/src-tauri/packages/linux/pre-remove.sh +++ b/src-tauri/packages/linux/pre-remove.sh @@ -1,2 +1,12 @@ #!/bin/bash /usr/bin/clash-verge-service-uninstall + +. /etc/os-release + +if [ "$ID" = "deepin" ]; then + if [ -f "/usr/share/applications/clash-verge.desktop" ]; then + echo "Removing deepin desktop file" + rm -vf "/usr/share/applications/clash-verge.desktop" + fi +fi +