From 211b18a98b6d97662d00e78e5e9a5f8a7f43b135 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 3 Nov 2025 06:44:53 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D-=E5=9C=A8=E9=93=B6=E6=B2=B3?= =?UTF-8?q?=E9=BA=92=E9=BA=9F=E4=B8=8A=E5=AE=89=E8=A3=85=E5=88=B0=20/usr/s?= =?UTF-8?q?hare?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenmo --- src/usr/bin/amber-pm-gxde-desktop-fix | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/usr/bin/amber-pm-gxde-desktop-fix b/src/usr/bin/amber-pm-gxde-desktop-fix index c248e02..b0a0bd9 100755 --- a/src/usr/bin/amber-pm-gxde-desktop-fix +++ b/src/usr/bin/amber-pm-gxde-desktop-fix @@ -3,6 +3,16 @@ if [[ ! -e "/usr/share/gxde-api" ]] && ! grep -q "Kylin" /etc/os-release; then exit 0 # No needed fi + +# 确定目标目录 +if grep -q "Kylin" /etc/os-release; then + TARGET_BASE="/usr/share" + echo "检测到麒麟系统,使用目标目录: $TARGET_BASE" +else + TARGET_BASE="/usr/local/share" + echo "检测到GXDE环境,使用目标目录: $TARGET_BASE" +fi + function ensure_dir() { local dir="$1" @@ -26,6 +36,7 @@ function ensure_dir() { return 0 fi } + # 函数:检查目录并创建符号链接 process_directory() { local source_dir="$1" @@ -40,15 +51,17 @@ process_directory() { fi } -ensure_dir "/usr/local/share/applications/" -ensure_dir "/usr/local/share/icons/" +# 使用动态确定的目标目录 +ensure_dir "$TARGET_BASE/applications/" +ensure_dir "$TARGET_BASE/icons/" + # 处理 applications 目录 process_directory "/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/applications/" \ - "/usr/local/share/applications/" "Applications" + "$TARGET_BASE/applications/" "Applications" # 处理 icons 目录 process_directory "/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/icons/" \ - "/usr/local/share/icons/" "Icons" + "$TARGET_BASE/icons/" "Icons" # 等待所有后台任务完成 -wait +wait \ No newline at end of file