From 717f2a13d686edd3b8edab51ff6f219de28a1709 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 24 Jul 2020 09:39:07 +0200 Subject: [PATCH] X: Remove xdg-user-dirs, manually set dirs with sh We already have a file which is strictly dedicated to xdg setting environment variables and taking care of folder creations. Using xdg-user-dirs as an application was basically doubling up on that. Also, I don't need my directories localized - I just want them to point to exactly where they should. --- X/.config/user-dirs.dirs | 16 ---------------- X/.config/user-dirs.locale | 1 - bootstrap/packages.txt | 1 - sh/.config/sh/xdg | 22 ++++++++++++++++++++++ 4 files changed, 22 insertions(+), 18 deletions(-) delete mode 100644 X/.config/user-dirs.dirs delete mode 100644 X/.config/user-dirs.locale diff --git a/X/.config/user-dirs.dirs b/X/.config/user-dirs.dirs deleted file mode 100644 index e258435..0000000 --- a/X/.config/user-dirs.dirs +++ /dev/null @@ -1,16 +0,0 @@ -# This file is written by xdg-user-dirs-update -# If you want to change or add directories, just edit the line you're -# interested in. All local changes will be retained on the next run. -# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped -# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an -# absolute path. No other format is supported. -# -XDG_DESKTOP_DIR="$HOME/desktop" -XDG_DOCUMENTS_DIR="$HOME/documents" -XDG_DOWNLOAD_DIR="$HOME/downloads" -XDG_MUSIC_DIR="$HOME/music" -XDG_PICTURES_DIR="$HOME/pictures" -XDG_PROJECTS_DIR="$HOME/projects" -XDG_PUBLICSHARE_DIR="$HOME/public" -XDG_TEMPLATES_DIR="$HOME/templates" -XDG_VIDEOS_DIR="$HOME/videos" diff --git a/X/.config/user-dirs.locale b/X/.config/user-dirs.locale deleted file mode 100644 index 3e0b419..0000000 --- a/X/.config/user-dirs.locale +++ /dev/null @@ -1 +0,0 @@ -en_US \ No newline at end of file diff --git a/bootstrap/packages.txt b/bootstrap/packages.txt index b0a696b..4a3fa30 100644 --- a/bootstrap/packages.txt +++ b/bootstrap/packages.txt @@ -136,7 +136,6 @@ vi vifm xcape xclip -xdg-user-dirs xorg-xev xorg-xinit xorg-xinput diff --git a/sh/.config/sh/xdg b/sh/.config/sh/xdg index 8754655..5051e41 100644 --- a/sh/.config/sh/xdg +++ b/sh/.config/sh/xdg @@ -19,6 +19,17 @@ test "$XDG_CACHE_HOME" || export XDG_CACHE_HOME="$HOME/.cache" test "$XDG_CONFIG_HOME" || export XDG_CONFIG_HOME="$HOME/.config" test "$XDG_DATA_HOME" || export XDG_DATA_HOME="$HOME/.local/share" +# Desktop environment XDG variables - mimics `xdg-user-dirs` settings, only lowercased and not localized +test "$XDG_DESKTOP_DIR" || export XDG_DESKTOP_DIR="$HOME/desktop" +test "$XDG_DOCUMENTS_DIR" || export XDG_DOCUMENTS_DIR="$HOME/documents" +test "$XDG_DOWNLOAD_DIR" || export XDG_DOWNLOAD_DIR="$HOME/downloads" +test "$XDG_MUSIC_DIR" || export XDG_MUSIC_DIR="$HOME/music" +test "$XDG_PICTURES_DIR" || export XDG_PICTURES_DIR="$HOME/pictures" +test "$XDG_PROJECTS_DIR" || export XDG_PROJECTS_DIR="$HOME/projects" +test "$XDG_PUBLICSHARE_DIR" || export XDG_PUBLICSHARE_DIR="$HOME/public" +test "$XDG_TEMPLATES_DIR" || export XDG_TEMPLATES_DIR="$HOME/templates" +test "$XDG_VIDEOS_DIR" || export XDG_VIDEOS_DIR="$HOME/videos" + ## Non-Standard additions # non-standard, is added to path to enable execution of any files herein test "$XDG_BIN_HOME" || export XDG_BIN_HOME="$HOME/.local/bin" @@ -29,6 +40,17 @@ 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" +# 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_PUBLICSHARE_DIR" || mkdir -p -m 0700 "$XDG_PUBLICSHARE_DIR" +test -d "$XDG_TEMPLATES_DIR" || mkdir -p -m 0700 "$XDG_TEMPLATES_DIR" +test -d "$XDG_VIDEOS_DIR" || mkdir -p -m 0700 "$XDG_VIDEOS_DIR" + ## Applications that can be set through environment variables export NVM_DIR="$XDG_DATA_HOME/nvm" export TMUX_PLUGIN_MANAGER_PATH="$XDG_DATA_HOME/tmux"