From 832cf2f197c97cbe3eea36e9d26c8f51f06449ac Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Sat, 8 Mar 2025 15:57:39 +0100 Subject: [PATCH] =?UTF-8?q?Feat:=20F=C3=BCgt=20XDG=5FCONFIG=20hinzu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Setup/0_Setup.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Setup/0_Setup.sh b/Setup/0_Setup.sh index 435fd7e..a16ab4a 100755 --- a/Setup/0_Setup.sh +++ b/Setup/0_Setup.sh @@ -45,5 +45,34 @@ else echo "Sudo-Hinweis ist bereits in bash.bashrc vorhanden." fi -echo "Fertig! Bitte neu einloggen oder 'source /etc/profile.d/custom_path.sh' & 'source /etc/bash.bashrc' ausführen." +XDG_BLOCK='# /etc/profile.d/desktop_session_xdg_dirs.sh - Prepend a $DESKTOP_SESSION-named directory to $XDG_CONFIG_DIRS and $XDG_DATA_DIRS + +DEFAULT_XDG_CONFIG_DIRS="/etc/xdg" +DEFAULT_XDG_DATA_DIRS="/usr/local/share/:/usr/share/" + +if [ -n "$DESKTOP_SESSION" ]; then + # readd default if was empty + if [ -z "$XDG_CONFIG_DIRS" ]; then + XDG_CONFIG_DIRS="$DEFAULT_XDG_CONFIG_DIRS" + fi + if [ -n "${XDG_CONFIG_DIRS##*$DEFAULT_XDG_CONFIG_DIRS/xdg-$DESKTOP_SESSION*}" ]; then + XDG_CONFIG_DIRS="$DEFAULT_XDG_CONFIG_DIRS"/xdg-"$DESKTOP_SESSION":"$XDG_CONFIG_DIRS" + fi + export XDG_CONFIG_DIRS + # gnome is already added if gnome-session installed + if [ "$DESKTOP_SESSION" != "gnome" ]; then + if [ -z "$XDG_DATA_DIRS" ]; then + XDG_DATA_DIRS="$DEFAULT_XDG_DATA_DIRS" + fi + if [ -n "${XDG_DATA_DIRS##*/usr/share/$DESKTOP_SESSION*}" ]; then + XDG_DATA_DIRS=/usr/share/"$DESKTOP_SESSION":"$XDG_DATA_DIRS" + fi + export XDG_DATA_DIRS + fi +fi +' + +echo "$XDG_BLOCK" >/etc/profile.d/xdg_dirs_desktop_session.sh + +echo "Fertig! Bitte neu einloggen."