]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - shell/env
shell/aliases,setup.sh: Move ls color detection to setup.sh.
[config/dotfiles.git] / shell / env
index a71dfc718784813d608e2a8ab7bdbd0208c24e17..2047e60a8aa5379d20b50aef8928ac0fa8d982e6 100644 (file)
--- a/shell/env
+++ b/shell/env
@@ -1,5 +1,20 @@
 # Configuration file for environment related options for all shells.
 
+# Copyright (C) 2011-2012  Simon Ruderich
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
 
 source_debug ". ~/.shell/env"
 
@@ -9,7 +24,10 @@ source_debug ". ~/.shell/env"
 LANG=en_US.UTF-8
 export LANG
 
-# Add ~/bin and ~/.bin to PATH if available.
+# Add ~/bin and ~/.bin and ~/.shell/bin to PATH if available.
+if [ -d ~/.shell/bin ]; then
+    PATH=~/.shell/bin:$PATH
+fi
 if [ -d ~/bin ]; then
     PATH=~/bin:$PATH
 fi
@@ -25,15 +43,25 @@ export EDITOR
 PAGER=less
 export PAGER
 
-# Use ~/tmp as directory for temporary files if available to reduce security
+# Use ~/.tmp as directory for temporary files if available to reduce security
 # problems on multi-user systems.
-if [ -O ~/tmp -a -d ~/tmp ]; then
+if [ -O ~/.tmp -a -d ~/.tmp ]; then
+    TMP=~/.tmp
+    TEMP=$TMP
+    TMPDIR=$TMP
+    export TMP TEMP TMPDIR
+# Also try ~/tmp as fallback.
+elif [ -O ~/tmp -a -d ~/tmp ]; then
     TMP=~/tmp
     TEMP=$TMP
     TMPDIR=$TMP
     export TMP TEMP TMPDIR
 fi
 
+# Change rlwrap's home directory to prevent cluttering ~.
+RLWRAP_HOME=~/.shell/rlwrap
+export RLWRAP_HOME
+
 # Set colors for GNU ls (and zsh completions).
 # See `dircolors --print-database` for possible colors.
 LS_COLORS='no=00'