Merge branch 'master' of github.com:flynx/bashctrl

This commit is contained in:
Alex A. Naanou 2023-06-12 12:46:57 +03:00
commit c2779adff8
3 changed files with 11 additions and 4 deletions

9
bashctrl Normal file → Executable file
View File

@ -49,7 +49,12 @@ DISABLED_PLUGINS=(
#----------------------------------------------------------------------
# helpers...
SCRIPT=`basename $0`
# when sourcing a script $0 is set to '-bash'...
if [ "$0" = "-bash" ] ; then
SCRIPT=bashctrl
else
SCRIPT=`basename $0`
fi
function printhelp(){ cat << EOF
Bash control script
@ -122,7 +127,7 @@ function update(){
|| echo " Generating: $FILE..."
{
echo "# Lines added/maintained by $SCRIPT:"
echo "$SCRIPT run $EVT"
echo "source ${BIN_DIR}/${SCRIPT} run $EVT"
echo
} >> $FILE
else

View File

@ -15,6 +15,9 @@ if [ $1 = "start" ] || [ $1 = 'login' ] ; then
alias alias_clear="mv ~/.bash/alias_lst ~/.bash/alias_lst.bak"
alias alias_revert="cp ~/.bash/alias_lst.bak ~/.bash/alias_lst"
[ -e ~/.bash/alias_list ] \
&& touch ~/.bash/alias_list
# external
if ! source ~/.bash/alias_lst ; then
# defaults

View File

@ -24,8 +24,7 @@ if [[ $BASH_PROFILE == 1 ]] ; then
else
PS1='\n\e[32m\u@\h \e[34m$__SHLVL__\e[33m\w\e[0m\n\$ '
fi
fi
if [[ $BASHRC == 1 ]] ; then
else
if [[ $SHLVL != 1 ]];then
__SHLVL__="($SHLVL$__LOGIN_PRESENT__) "
fi