#!/bin/sh

# Included from .profile and .bashrc with command:
# test -f ~/.profile_gensys && . ~/.profile_gensys

# On new files, don't set write permission for group and others
umask u=rwx,g=rx,o=rx

#
# User specific aliases and functions
#
 alias cd..='cd .. && \pwd'
 alias cp='cp -ip'
 alias egrep='egrep --color=auto'
 alias grep='grep --color=auto'
#alias ls='ls -C --color=auto --quoting-style=shell-escape --time-style=long-iso'
 alias ls='ls -C --file-type --quoting-style=shell-escape --time-style=long-iso'
 alias mv='mv -i'
 alias rm='rm -i'
 alias rsync='rsync -itv --modify-window=2 --chmod=ugo=rwX'
 alias "c=xclip"                          ;# echo "abc123" | c     # Copy  to   XA_PRIMARY
 alias "v=xclip -o"                       ;# echo `v`              # Paste from XA_PRIMARY
 alias "cc=xclip -selection clipboard"    ;# echo "abc123" | cc    # Copy  to   XA_CLIPBOARD
 alias "vc=xclip -o -selection clipboard" ;# echo `vc`             # Paste from XA_CLIPBOARD

#
#
#      Define environment variables and search path to GENSYS
#
 export gensys=/opt/gensys/gensys-2303          ;# Define the address to program GENSYS
 export gendel=/tmp/gensys_trash                ;# Move deleted files to this directory for 3 days
 export genhomepage=$HOME/gensys/homepage       ;# Location of the Users Manual
#export genhomepage=/media/samba_2/homepage     ;# Location of the Users Manual
 export genverif=$HOME/gensys/verif             ;# Gensys verif directory
 export genkpf=$genverif/kpf/kpfr               ;# Directory for common wheel-rail geometry files
 export gentrc=$genverif/track/ver_data         ;# Directory for common track irregularity files
#export genedit=xed                             ;# Choose editor xed instead of the default editor nedit

 echo $PATH  | grep $HOME/bin           > /dev/null || PATH=$PATH:$HOME/bin             ;# Add $HOME/bin to your path
 echo $PATH  | grep $HOME/gensys/zbin   > /dev/null || PATH=$PATH:$HOME/gensys/zbin     ;# Add $HOME/gensys/zbin to your path
 echo $PATH  | grep $gensys/bin         > /dev/null || PATH=$PATH:$gensys/bin           ;# Add $gensys/bin to your path

#
# Set the promter in a xterm-window
#
if [ "$TERM" = "linux" ]; then
 export PS1="\[\e[31m\]\u@\H \$? \[\e[0m\]"
else
 export PS1="\[\e]1;\W\a\e]2;\w\a\e[31m\] \$? \[\e[0m\]"
fi
export PROMPT_DIRTRIM=12

#
# Set the default printer
#
if [ -z "`env | grep LPDEST`" ]; then
 export LPDEST=my_printer
fi
if [ -z "`env | grep PRINTER`" ]; then
 export PRINTER=$LPDEST
fi

# Write "set -o vi" to use the command line "vi" editor