sh: Remove auto-creation of xdg directories

Removed the test-if-it-exists create-if-not cycle of manual xdg
intervention on every shell startup since it created mostly nothing but
problems so far.

It especially gets in the way of creating network filesystem mappings in
the home folder with hangups, freezes, and blocking automounts whenever
a new shell session is opened.
This commit is contained in:
Marty Oehme 2023-08-07 10:48:52 +02:00
parent 17dbb6a5ab
commit 112d6d8fa9
Signed by: Marty
GPG Key ID: EDBF2ED917B2EF6A
1 changed files with 0 additions and 35 deletions

View File

@ -37,41 +37,6 @@ test "$XDG_BIN_HOME" || export XDG_BIN_HOME="$HOME/.local/bin"
# anything on BIN_HOME should be executable form anywhere
export PATH="$PATH:$XDG_BIN_HOME"
xdg_isThere() {
if [ -e "$1" ] || [ -h "$1" ]; then
true
else
false
fi
}
xdg_makeForUser() {
mkdir -p "$1"
chmod 0700 "$1"
}
if [ -h "$XDG_MEDIA_DIR" ] && [ ! -e "$XDG_MEDIA_DIR" ]; then
rm "$XDG_MEDIA_DIR"
xdg_makeForUser "$XDG_MEDIA_DIR"
fi
## ensure directories exist
xdg_isThere "$XDG_BIN_HOME" || xdg_makeForUser "$XDG_BIN_HOME"
xdg_isThere "$XDG_CACHE_HOME" || xdg_makeForUser "$XDG_CACHE_HOME"
xdg_isThere "$XDG_CONFIG_HOME" || xdg_makeForUser "$XDG_CONFIG_HOME"
xdg_isThere "$XDG_DATA_HOME" || xdg_makeForUser "$XDG_DATA_HOME"
# create xdg-user-dirs if necessary
xdg_isThere "$XDG_DESKTOP_DIR" || xdg_makeForUser "$XDG_DESKTOP_DIR"
xdg_isThere "$XDG_DOCUMENTS_DIR" || xdg_makeForUser "$XDG_DOCUMENTS_DIR"
xdg_isThere "$XDG_DOWNLOAD_DIR" || xdg_makeForUser "$XDG_DOWNLOAD_DIR"
xdg_isThere "$XDG_MUSIC_DIR" || xdg_makeForUser "$XDG_MUSIC_DIR"
xdg_isThere "$XDG_PICTURES_DIR" || xdg_makeForUser "$XDG_PICTURES_DIR"
xdg_isThere "$XDG_VIDEOS_DIR" || xdg_makeForUser "$XDG_VIDEOS_DIR"
xdg_isThere "$XDG_PROJECTS_DIR" || xdg_makeForUser "$XDG_PROJECTS_DIR"
unset -f xdg_isThere xdg_makeForUser
## Applications that can be set through environment variables
export ANDROID_HOME="$XDG_DATA_HOME/android"
export ATOM_HOME="$XDG_DATA_HOME/atom"