From 02a81627935520c11c240d8af1cbcf3404bd8b20 Mon Sep 17 00:00:00 2001 From: shenmo Date: Fri, 24 Oct 2025 13:41:56 +0800 Subject: [PATCH] =?UTF-8?q?1.0.8=20=E4=BF=AE=E5=A4=8DGXDE=E4=B8=8A?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DEBIAN/control | 2 +- src/usr/bin/amber-pm-gxde-desktop-fix | 30 +++++++++++++++++++++++++++ src/usr/bin/apm | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 src/usr/bin/amber-pm-gxde-desktop-fix diff --git a/src/DEBIAN/control b/src/DEBIAN/control index f6f0e23..23d00d3 100755 --- a/src/DEBIAN/control +++ b/src/DEBIAN/control @@ -3,7 +3,7 @@ Source: amber-ce Version: 1.0.8 Architecture: amd64 Maintainer: shenmo -Installed-Size: 48712 +Installed-Size: 48716 Depends: bubblewrap, flatpak, policykit-1 | pkexec | polkit-1 | polkit, systemd, procps,coreutils,fuse-overlayfs,xz-utils Section: misc Conflicts: ace-host-integration diff --git a/src/usr/bin/amber-pm-gxde-desktop-fix b/src/usr/bin/amber-pm-gxde-desktop-fix new file mode 100755 index 0000000..44cb265 --- /dev/null +++ b/src/usr/bin/amber-pm-gxde-desktop-fix @@ -0,0 +1,30 @@ +#!/bin/bash + +if [[ ! -e "/usr/share/gxde-api" ]];then +exit 0 # No needed +fi + +# 函数:检查目录并创建符号链接 +process_directory() { + local source_dir="$1" + local target_dir="$2" + local name="$3" + + if [ -d "$source_dir" ] && [ -n "$(ls -A "$source_dir")" ]; then + ln -sv $source_dir/* "$target_dir" 2>/dev/null + find "$target_dir" -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null & + else + echo "$name directory is empty or does not exist, skipping..." + fi +} + +# 处理 applications 目录 +process_directory "/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/applications/" \ + "/usr/local/share/applications/" "Applications" + +# 处理 icons 目录 +process_directory "/var/lib/apm/apm/files/ace-env/amber-ce-tools/data-dir/icons/" \ + "/usr/local/share/icons/" "Icons" + +# 等待所有后台任务完成 +wait \ No newline at end of file diff --git a/src/usr/bin/apm b/src/usr/bin/apm index 9d0d53d..7f3abb0 100755 --- a/src/usr/bin/apm +++ b/src/usr/bin/apm @@ -120,6 +120,7 @@ case "$1" in fi amber-pm-debug amber-pm-dstore-patch apm-nvidia-toggle + amber-pm-gxde-desktop-fix ;; download|search|policy|list|update|clean) command=$1 @@ -147,6 +148,7 @@ case "$1" in exit $exit_code fi amber-pm-debug amber-pm-dstore-patch + amber-pm-gxde-desktop-fix ;; run) # 运行包命令:第二个参数必须是包名