# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
alias ll='ls -l --group-directories-first'
alias home='cd ~/disks/s'
#alias linux="enable set;set +f;b_env=linux;enable -n set"	# switch to Linux mode
#alias theox="enable set;set -f;b_env=theox;enable -n set"	# switch to TheoX mode
alias linux="set +f;b_env=linux"	# switch to Linux mode
alias theox="set -f;b_env=theox"	# switch to TheoX mode
enable -n help

PS1='[$b_env:$?:$b_account \w]$ '

# TheoX and TXBasic environment

b_s=/home/system/disks/s
b_tx=$b_s/theox
b_config=$b_tx/config

set -o allexport
b_account=`echo $HOME|cut -d / -f 3`	# get account name from home directory
. $b_config/licenses	# TheoX license
. $b_config/sysconfig	# TheoX global environment
. $b_config/ttyconfig	# TheoX interactive session environment
set +o allexport

if [[ "$-" == *i* ]]; then
 # path to system account commands
 [[ "`echo $PATH|grep $b_tx/command:`" == "" ]] && PATH=$b_s:$b_tx/command:$b_tx/bin:$PATH
 # account additional path
 path=`$b_tx/os/accparam b_path`
 [[ "$path" != "" ]] && PATH=$path:$PATH
 # add current directory at top of path
 [[ "`echo $PATH|grep '^.:'`" == "" ]] && PATH=.:$PATH
 export PATH

 # TheoX emulation
 linux					# switch to linux mode
 home					# change current directory to virtual disk S
# enable -n set
fi
