diff --git a/sh/.config/sh/xdg b/sh/.config/sh/xdg index cc00e45..a018ca3 100644 --- a/sh/.config/sh/xdg +++ b/sh/.config/sh/xdg @@ -32,20 +32,35 @@ test "$XDG_VIDEOS_DIR" || export XDG_VIDEOS_DIR="$HOME/videos" # non-standard, is added to path to enable execution of any files herein test "$XDG_BIN_HOME" || export XDG_BIN_HOME="$HOME/.local/bin" +xdg_isThere() { + if [ -e "$1" ] || [ -h "$1" ]; then + true + else + false + fi +} + +xdg_makeForUser() { + mkdir -p "$1" + chmod 0700 "$1" +} + ## ensure directories exist -test -d "$XDG_BIN_HOME" || mkdir -p -m 0700 "$XDG_BIN_HOME" -test -d "$XDG_CACHE_HOME" || mkdir -p -m 0700 "$XDG_CACHE_HOME" -test -d "$XDG_CONFIG_HOME" || mkdir -p -m 0700 "$XDG_CONFIG_HOME" -test -d "$XDG_DATA_HOME" || mkdir -p -m 0700 "$XDG_DATA_HOME" +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 -test -d "$XDG_DESKTOP_DIR" || mkdir -p -m 0700 "$XDG_DESKTOP_DIR" -test -d "$XDG_DOCUMENTS_DIR" || mkdir -p -m 0700 "$XDG_DOCUMENTS_DIR" -test -d "$XDG_DOWNLOAD_DIR" || mkdir -p -m 0700 "$XDG_DOWNLOAD_DIR" -test -d "$XDG_MUSIC_DIR" || mkdir -p -m 0700 "$XDG_MUSIC_DIR" -test -d "$XDG_PICTURES_DIR" || mkdir -p -m 0700 "$XDG_PICTURES_DIR" -test -d "$XDG_PROJECTS_DIR" || mkdir -p -m 0700 "$XDG_PROJECTS_DIR" -test -d "$XDG_VIDEOS_DIR" || mkdir -p -m 0700 "$XDG_VIDEOS_DIR" +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_PROJECTS_DIR" || xdg_makeForUser "$XDG_PROJECTS_DIR" +xdg_isThere "$XDG_VIDEOS_DIR" || xdg_makeForUser "$XDG_VIDEOS_DIR" + +unset -f xdg_isThere xdg_makeForUser ## Applications that can be set through environment variables export NVM_DIR="$XDG_DATA_HOME/nvm" diff --git a/vifm/.config/vifm/vifmrc b/vifm/.config/vifm/vifmrc index 811d889..483245b 100644 --- a/vifm/.config/vifm/vifmrc +++ b/vifm/.config/vifm/vifmrc @@ -118,7 +118,6 @@ set findprg='fd %A --hidden --exclude .git --exclude node_modules' mark h ~/ mark d ~/downloads/ mark p ~/projects/ -mark s ~/projects/studentassistant/ mark i ~/pictures/ mark v ~/videos/ mark n ~/documents/notes/