dot/screenrc: Turn off XON/XOFF flow control.
[profile] / dot / bash_profile
index 1621d13..d61a7c3 100644 (file)
@@ -1,10 +1,9 @@
-### -*-sh-*-
+### -*-bash-*-
 ###
 ### Bash startup things
 
-## Only do any of this if we haven't done it before.  Otherwise we
-## can have loops and lots of wasted time.
-if [ -z "$__mdw_profile" ]; then
+## The `.bashrc' hook will run us if it thinks we haven't been run before.
+## We should therefore let it know.
 export __mdw_profile=done
 
 ###--------------------------------------------------------------------------
@@ -59,10 +58,6 @@ __mdw_programp () { type -t >/dev/null "$1"; }
 HOME=`(set -P; cd $HOME; pwd)`
 cd $HOME
 
-## Establish a temporary directory.
-[ "$TMPDIR" ] || eval `tmpdir -b`
-export TMP=$TMPDIR
-
 ## CDE's session structure is demented and doesn't leave us with a proper
 ## logout hook, so synthesize one here.
 [ -n "$DT" ] && trap "source $HOME/.bash_logout" EXIT
@@ -73,7 +68,7 @@ export TMP=$TMPDIR
 ## The main path.
 __mdw_addto PATH l \
   $HOME/bin \
-  {,/usr{,/local}{,/X11R6}}{/bin,/sbin,/games} \
+  {/usr{/local,}{,/X11R6},}{/bin,/sbin,/games} \
   /opt/nfast{,/gcc}{/bin,/sbin} \
   $HOME/src/ncipher/scripts
 
@@ -98,6 +93,10 @@ __mdw_addto PYTHONPATH r $HOME/lib/python
 ###--------------------------------------------------------------------------
 ### Various other kinds of configuration.
 
+## Establish a temporary directory.
+[ "$TMPDIR" ] || eval `tmpdir -b`
+export TMP=$TMPDIR
+
 ## Sensible umask if users have their own groups.
 umask 002
 
@@ -150,7 +149,7 @@ export LC_COLLATE=POSIX LANG
 
 ## Pager configuration.
 export MDW_PAGER=`type -p less` PAGER=mdw-pager METAMAIL_PAGER=mdw-pager
-export LESS="-iqgRh1FX"
+export LESS="-iqgRh1FSX"
 export LESSOPEN="|lesspipe.sh %s"
 case "${LC_CTYPE-$LANG}" in
   *utf8 | *utf-8 | *UTF8 | *UTF-8) LESSCHARSET=utf-8 ;;
@@ -182,6 +181,20 @@ export PERL_READLINE_NOWARN=yes
 ## If we have `distcc' then tell `ccache' to use it.
 __mdw_programp distcc && export CCACHE_PREFIX=distcc
 
+## Choose a sensible web browser.  If we have a display, try to pick a
+## graphical one.
+browsers="elinks w3m lynx"
+case "${DISPLAY+t}" in
+  t) browsers="mdw-chrome iceweasel firefox $browsers" ;;
+esac
+for i in $browsers; do
+  if __mdw_programp $i; then
+    export BROWSER=$i
+    break
+  fi
+done
+unset browsers
+
 ## Acquiring root privileges.  This is mainly the job of `bashrc', but we
 ## cache the mechanism here.
 export __MDW_ROOTLY=`mdw-conf rootly`
@@ -272,9 +285,6 @@ fi
 ## If there's a local hook then run it.
 [ -f "$HOME/.profile-local" ] && . "$HOME/.profile-local"
 
-## End of the `__mdw_profile' guard.
-fi
-
 ## If we haven't run the `.bashrc' yet, and this shell is interactive, then
 ## run it now.
 [ -z "$__mdw_bashrc" ] && [ -t 0 ] && \