From 1e883519643368ec04a4caeb3389613c7d87fa09 Mon Sep 17 00:00:00 2001 From: RX6900XT Date: Mon, 13 Nov 2023 10:19:37 +0000 Subject: [PATCH] =?UTF-8?q?update=20src/etc/profile.d/bookworm-compatabili?= =?UTF-8?q?ty-mode.sh.=20=E9=92=88=E5=AF=B9ubuntu=E5=8F=91=E8=A1=8C?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=81=9A=E5=87=BA=E4=BF=AE=E6=AD=A3=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8deepin=E4=B8=8B=E4=B9=9F=E8=83=BD=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RX6900XT --- .../profile.d/bookworm-compatability-mode.sh | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/etc/profile.d/bookworm-compatability-mode.sh b/src/etc/profile.d/bookworm-compatability-mode.sh index e255bba..d9e1297 100755 --- a/src/etc/profile.d/bookworm-compatability-mode.sh +++ b/src/etc/profile.d/bookworm-compatability-mode.sh @@ -1,4 +1,18 @@ -export XDG_DATA_DIRS -APP_ROOT="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env/usr/share" -XDG_DATA_DIRS="${APP_ROOT}:/usr/local/share:/usr/share" -export APP_ROOT +# shellcheck shell=sh + + + +# Ensure base distro defaults xdg path are set if nothing filed up some +# defaults yet. +if [ -z "$XDG_DATA_DIRS" ]; then + export XDG_DATA_DIRS="/usr/local/share:/usr/share" +fi + +# Desktop files (used by desktop environments within both X11 and Wayland) are +# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for +# snappy applications' desktop files. +bcm_path="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env/usr/share/" +if [ -n "${XDG_DATA_DIRS##*${bcm_path}}" ] && [ -n "${XDG_DATA_DIRS##*${bcm_path}:*}" ]; then + export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${bcm_path}" +fi +