# assume this will be sourced, so no pound-bang-bin-sh
# bprofile



# Joseph Rosevear 170128 I made this by copying and tailoring
# tips/bash_profile.  This file can be sourced by a modified begin. 
# I'm setting up a copy of SAM to run from
# /mnt/150605aa2.

# Joseph Rosevear 171215 I added to this code to learn where it is and to
# call it "bplace".  It then exports and uses bplace.

# Joseph Rosevear 180316 I changed printer in the vostro section.

# Joseph Rosevear 180329 I added definition and export of sam_distro.

# Joseph Rosevear 180329 I changed bplace to sam_root.

# Joseph Rosevear 180329 I cleaned up by removing some in-line comments.

# Joseph Rosevear 180922 I added box vostro-home.

# Joseph Rosevear 190204 I moved the "Announce where we are" to the
# top.

# I inserted the code that was in bashrc.  Previously I had intended
# that users would symlink to it to create files .bashrc.  This didn't
# work well, as .bashrc doesn't run in all shells and one of the things
# it did--defining aliases--was troubled by aliases not being inherited
# by shells.

# So I inserted the code here, but commented out the aliases.  I
# re-made the aliases as scripts in example/handy.

# I also commented out two lines that defined LS_OPTIONS.  I discovered
# that

#    /etc/profile.d/coreutils-dircolors.sh

# does this already so I will let it.

# Joseph Rosevear 190206 I added box latitude-fumcsd.

# Joseph Rosevear 190720 I commented out a redundant stty erase, and I
# updated the line that tells where we are to use BASH_SOURCE.

# Joseph Rosevear 190721 I commented out the other stty erase.  It
# seems this code doesn't work well (if at all) this way.  I don't know
# why.  See my backspace lesson.

# Joseph Rosevear 200112 I changed the printer for prodesk.



# Define and export sam_root
sam_root=`dirname $0`
export sam_root

# Announce where we are
echo "in $BASH_SOURCE"

# This is my personal .bash_profile file.  When you apply it to your
# own use you will want to fix these:
#
# umask, TZ, EDITOR, NNTPSERVER, sam_set_version, sam_gui_data,
# sam_temp_base, sam_env, cd_speed, cd_dev

# set mask
# I have been using 067 and initial group, users

# Sam, the SAM maintainer has been using 022 and initial group, users

# Set umask using .SAM.umask
umask `cat $HOME/.SAM.umask`

# Set variables and make some dirs
#
# JHR 170305 I changed the definition of name below.
# name=`basename $HOME`
name=`whoami`
export TZ='America/Los_Angeles'
export EDITOR=exed
export NNTPSERVER=`cat $HOME/.SAM.NNTPSERVER`
#
# These are for SAM
#
#export sam_set_version=1
export sam_set_version=2
#
# Was "export sam_temp_base=/tmp/$name/sam"
# Now "export sam_temp_base=/var/opt/SAM/$name"
# Note that you will need /opt/SAM/tips/rc.SAM in order to use this
# value for sam_temp_base.

# JHR 170128 I changed the line below.
# export sam_temp_base=/var/opt/SAM/$name
export sam_temp_base=/tmp/$name

#
unset glos
#

# export sam_env=$HOME/sam_env
# Joseph Rosevear 171215
export sam_env=$sam_root/sam_env

# Joseph Rosevear 180329
export sam_distro=$sam_root/opt/SAM

#
# This fixes backspace in scripts
# This was accidentally used twice, so I commented one out.
#stty erase `tput kbs`

#Tailor this for the box
case `cat /var/opt/JBD/box` in

     msi) export cd_speed=1;
          export cd_dev=0,0,0;
          echo .bash_profile: unable to set printer;
          unset printer;;
          
vostro*)
          export cd_speed=1;
          export cd_dev=/dev/sr1;
          #export printer=homebw1d;
          export printer=HomeBW;
          export radio_equalizer=\
"-3.0 -8.64 -2.40 4.80 4.80 0.00 -4.32 -8.16 -10.08 -12.00 -12.00";
          export radio_adjust=120;;
          
 prodesk) export cd_speed=1;
          export cd_dev=/dev/sr1;
          #export printer=homebw1d;
          export printer=HomeBW;
          export radio_equalizer=\
"5.76 -6.00 1.00 5.00 4.80 0.00 -6.00 -10.00 -12.00 -11.00 -9.00";
          export radio_adjust=120;;
          
round|round-fw)
          export cd_speed=1;
          export cd_dev=/dev/sr0;
          unset printer;;
          
latitude*)
          export cd_speed=1;
          export cd_dev=/dev/sr0;
          export printer=Fin_CO;
          export radio_equalizer=\
"5.76 -8.64 -2.40 4.80 4.80 0.00 -4.32 -8.16 -10.08 -12.00 -12.00";
          export radio_adjust=120;;

       *) export cd_speed=1;
          echo .bash_profile: unable to set cd_dev;
          unset cd_dev;
          echo .bash_profile: unable to set printer;
          unset printer;;
esac

# Here is a block of code that was in my .bashrc.  Then I learned that
# .bashrc doesn't run in some shells.  So I moved it here.

# Don't do this here.  Also don't depend on
#
#    /etc/profile.d/coreutils-dircolors.sh
#
# to do this.  It makes the same alias definitions, but aliases are not
# inherited by shells so that doesn't do what I want.  Instead I made
# commands
#
#    _dir
#    _ls
#    _vdir
#
# in example/handy which do the same thing:
#
# alias d='dir'
# alias dir='/bin/ls $LS_OPTIONS --format=vertical'
# alias ls='/bin/ls $LS_OPTIONS'
# alias v='vdir'
# alias vdir='/bin/ls $LS_OPTIONS --format=long'
# alias

export PAGER="less -R"
export METAMAIL_PAGER="less -R"
export LESSCHARSET=latin1

# Don't do this here. Instead use /etc/profile.d/coreutils-dircolors.sh
# I changed the line below.
# export LS_OPTIONS='--color=auto'
# export LS_OPTIONS=' --color=always -F -b -T 0'

# JHR 080220 This was suggested by Alan Hicks It is needed to enable
# backspace in scripts running in xterm in Slackware 12.0, although I
# don't understand why. I hope it doesn't break in other versions of
# Slackware.

# It seems this doesn't work outside of .bashrc, so I commented it out.

#if [ "$TERM" = "xterm" ]; then
#   stty erase $(tput kbs)
#fi

# End of block of code that was in my .bashrc.
