From 112d6d8fa915a8af013919a00830bd037c87a391 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 7 Aug 2023 10:48:52 +0200 Subject: [PATCH] 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. --- sh/.config/sh/xdg | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/sh/.config/sh/xdg b/sh/.config/sh/xdg index fe82615..45407b5 100644 --- a/sh/.config/sh/xdg +++ b/sh/.config/sh/xdg @@ -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"