]> code.delx.au - dotfiles/blobdiff - .bash/environment
fontconfig: -apple-system font
[dotfiles] / .bash / environment
index 96a4187e9d5ffb6caedcc7c18d951f3c07a9d2a1..e14b4e9721a872e3f9d32dd62ce2dac037257d51 100644 (file)
@@ -4,17 +4,35 @@
 # so it must be fast. Also, starting a shell within a shell shouldn't change
 # the environment. The path manipulation functions are useful for this.
 
-# Files will be created by default rwx user only
-umask 0077
+# Root gets the default umask. Files created by my user are only rwx by user/group
+if [ "$(id -un)" = "root" ]; then
+    umask 0022
+else
+    umask 0007
+fi
 
 # General environment settings
 export PAGER="less"
-export EDITOR="vim"
-export CVS_RSH="ssh"
-export RSYNC_RSH="ssh"
 export PYTHONSTARTUP="${HOME}/.pythonrc.py"
-export HISTCONTROL="ignoredups"
-export HISTSIZE="10000"
+export EMAIL="James Bunton <jamesbunton@delx.net.au>"
+
+# Editor settings
+if emacsclient --version &> /dev/null; then
+    export ALTERNATE_EDITOR="vim"
+    export EDITOR="emacsclient --tty"
+
+    if [[ "$TERM" == screen* ]]; then
+        export EDITORBG="$EDITOR"
+    else
+        export EDITORBG="emacsclient --create-frame --no-wait"
+    fi
+else
+    export EDITOR="vim"
+    export EDITORBG="vim"
+fi
+
+# Expand any symbolic links in the TMPDIR environment variable
+[ -n "$TMPDIR" ] && export TMPDIR="$(cd "${TMPDIR}" && pwd -P)"
 
 # Load the bash functions
 source "${HOME}/.bash/functions"
@@ -23,7 +41,7 @@ source "${HOME}/.bash/functions"
 pathremove .
 
 # Load local environment settings
-ssource "${HOME}/.bash/environment_local"
+[ -r "${HOME}/.bash/environment_local" ] && source "${HOME}/.bash/environment_local"
 
 # ~/bin should be in the front of path if it exists
 pathprepend "${HOME}/bin"