]> code.delx.au - dotfiles/commitdiff
bash: read all environment.d
authorJames Bunton <jamesbunton@delx.net.au>
Mon, 19 Nov 2018 12:45:04 +0000 (23:45 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Mon, 19 Nov 2018 12:45:38 +0000 (23:45 +1100)
.bashrc

diff --git a/.bashrc b/.bashrc
index ef54a276d22102442ffb6c8646ff4aca7f7b772a..b38679a6cdae52d5c9e301cb7601a3e46933c0e2 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -17,9 +17,8 @@ while read -r p; do
 done < <(find -L ~/bin -maxdepth 1 -type d 2> /dev/null)
 
 # Set EMAIL from the freedesktop environment.d
-if [ -r ~/.config/environment.d/10-email.conf ]; then
-    source ~/.config/environment.d/10-email.conf
-    export EMAIL
+if ls ~/.config/environment.d/*.conf &> /dev/null; then
+    eval "$(awk -F= '{print $0 ";export " $1}' ~/.config/environment.d/*.conf)"
 fi
 
 # Pick up SSH agent socket
@@ -71,7 +70,7 @@ export HISTTIMEFORMAT='%F %T '
 stty -ixon
 
 # hostname:workingdir
-PROMPT_COMMAND='echo -ne "\\033]0;$(hostname| cut -d. -f1):${PWD/$HOME/~}\\007"'
+PROMPT_COMMAND='echo -ne "\\033]0;$(hostname|cut -d. -f1):${PWD/$HOME/~}\\007"'
 
 
 #############
@@ -172,8 +171,7 @@ fi
 ##########################
 
 # GNU ls colours
-# shellcheck disable=SC2046
-eval $(TERM=xterm dircolors 2> /dev/null)
+eval "$(TERM=xterm dircolors 2> /dev/null)"
 
 # BSD ls colours
 export LSCOLORS="ExFxCxDxBxEGEDABAGACAD"