summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrell Anderson <darrella@clovermail.net>2025-09-03 04:10:12 +0300
committerAlexander Golubev <fatzer2@gmail.com>2025-10-24 16:48:41 +0300
commit6fac1bccedf2267e3ce56cc61bf08d41bfbc7f47 (patch)
treef43d5f449f3032d1afe0a6b0263d6e9a5c99fcdf
parent6d02f6afe34c2b816889d1180dcd3c62629a7611 (diff)
downloadtdebase-6fac1bccedf2267e3ce56cc61bf08d41bfbc7f47.tar.gz
tdebase-6fac1bccedf2267e3ce56cc61bf08d41bfbc7f47.zip
starttde: set XDG_CURRENT_DESKTOP unless already defined
Bug: https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/issues/322 Co-authored-by: Alexander Golubev <fatzer2@gmail.com> Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
-rwxr-xr-xstarttde22
1 files changed, 20 insertions, 2 deletions
diff --git a/starttde b/starttde
index 67f2baf78..85566e973 100755
--- a/starttde
+++ b/starttde
@@ -346,9 +346,27 @@ echo "[starttde] XDG_DATA_DIRS: $XDG_DATA_DIRS" 1>&2
test -n "$TDEHOME" && tdehome=$(echo "$TDEHOME" | sed "s,^~/,$HOME/,")
-# Allow interested applications, such as the Plasma control wrapper,
-# to know that this is a Trinity desktop and not a KDE one.
+# Help non-TDE software identify the desktop environment.
+#
+# DESKTOP_SESSION is considered legacy but retained for backwards
+# compatibility.
export DESKTOP_SESSION=trinity
+# XDG_CURRENT_DESKTOP is considered the correct way to identify desktop
+# environments. This is the variable xdg-utils uses although xdg-utils
+# does not explicitly support TDE. Acceptable desktop identifiers are found in
+# Appendix B of the Desktop Menu Specification:
+# https://specifications.freedesktop.org/menu-spec/latest/apb.html
+# Note: The variable should be already set by most modern DMs (including TDM
+# since R14.0.12), but when launching TDE manually via startx, it's unlikely to
+# be defined, so set it here. Also note that the variable is allowed to contain
+# multiple colon-separated identifiers.
+if [ -n "$XDG_CURRENT_DESKTOP" ]; then
+ echo "[starttde] Setting XDG_CURRENT_DESKTOP=TDE" 1>&2
+ export XDG_CURRENT_DESKTOP=TDE
+elif ! is_in_path XDG_CURRENT_DESKTOP "TDE"; then
+ echo "[starttde] Setting XDG_CURRENT_DESKTOP=TDE:$XDG_CURRENT_DESKTOP" 1>&2
+ export XDG_CURRENT_DESKTOP=TDE:$XDG_CURRENT_DESKTOP
+fi
# If necessary create the profile directory.
if [ ! -d "$tdehome" ]; then