From ceb390c840788a8db4238e8c8bc6e0b996290798 Mon Sep 17 00:00:00 2001 From: xyz Date: Fri, 13 Aug 2021 20:23:22 -0700 Subject: export XDG_XXX_DIR env var in user-dirs.dirs, refactor --- .bash_profile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to '.bash_profile') diff --git a/.bash_profile b/.bash_profile index 54538100..6cd46928 100644 --- a/.bash_profile +++ b/.bash_profile @@ -2,12 +2,26 @@ # ~/.bash_profile # -[[ -f ~/.bashrc ]] && . ~/.bashrc +# here `. ~/.bashrc` same as `source ~/.bashrc`, see `source filename` in `man bash`, and `. file` in `man dash` +# `. file` is POSIX compliant, while `source file` is not +# https://github.com/koalaman/shellcheck/wiki/SC3046 +#[[ -f ~/.bashrc ]] && . ~/.bashrc +[ -f ~/.bashrc ] && . ~/.bashrc export XDG_CONFIG_HOME="$HOME/.config" export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/.local/share" +. "$XDG_CONFIG_HOME/user-dirs.dirs" +export XDG_DESKTOP_DIR="$XDG_DESKTOP_DIR" +export XDG_DOWNLOAD_DIR="$XDG_DOWNLOAD_DIR" +export XDG_TEMPLATES_DIR="$XDG_TEMPLATES_DIR" +export XDG_PUBLICSHARE_DIR="$XDG_PUBLICSHARE_DIR" +export XDG_DOCUMENTS_DIR="$XDG_DOCUMENTS_DIR" +export XDG_MUSIC_DIR="$XDG_MUSIC_DIR" +export XDG_PICTURES_DIR="$XDG_PICTURES_DIR" +export XDG_VIDEOS_DIR="$XDG_VIDEOS_DIR" + export PATH="$(find ~/.local/bin -type d -printf %p:)$PATH" export HISTSIZE=5000 export HISTFILESIZE=5000 -- cgit v1.2.3-70-g09d2