]> code.delx.au - dotfiles/commitdiff
bashrc: set LANG from config file
authorJames Bunton <jamesbunton@delx.net.au>
Sun, 4 Aug 2019 12:45:11 +0000 (22:45 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Sun, 4 Aug 2019 12:45:11 +0000 (22:45 +1000)
.bashrc

diff --git a/.bashrc b/.bashrc
index 7edd8caac413d3ca1ac19027ac59c8d8cb11013a..d78b919c15b1e33e6767cfae6c44d37524f92211 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -17,10 +17,8 @@ while read -r p; do
     echo "$PATH" | tr ':' '\n' | grep -qxF "$p" || PATH="${p}:$PATH"
 done < <(find -L ~/bin -maxdepth 1 -type d 2> /dev/null)
 
-# Set EMAIL from the freedesktop environment.d
-if ls ~/.config/environment.d/*.conf &> /dev/null; then
-    eval "$(awk -F= '{print $0 ";export " $1}' ~/.config/environment.d/*.conf)"
-fi
+# Set environment variables, eg EMAIL, LANG
+eval "$(cat 2> /dev/null /etc/default/locale /etc/locale.conf ~/.config/environment.d/*.conf | awk -F= '/^[^# ]/ {print $0 ";export " $1}')"
 
 # Pick up SSH agent socket
 if [ -z "$SSH_AUTH_SOCK" ]; then