From 333511a90278e19fcb90245a38707268401880ee Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 13 Jul 2022 21:40:50 +0300 Subject: [PATCH 1/4] chmod +x ... Signed-off-by: Alex A. Naanou --- bashctrl | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bashctrl diff --git a/bashctrl b/bashctrl old mode 100644 new mode 100755 From 5ef973d2a44c446e7031d96c29edb583aa22496e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 13 Jul 2022 22:03:08 +0300 Subject: [PATCH 2/4] some tweaks... Signed-off-by: Alex A. Naanou --- bashctrl | 2 +- plugins/alias | 3 +++ plugins/prompt | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bashctrl b/bashctrl index fbaa4f8..c73f763 100755 --- a/bashctrl +++ b/bashctrl @@ -122,7 +122,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 diff --git a/plugins/alias b/plugins/alias index fbdcca4..c5116bf 100644 --- a/plugins/alias +++ b/plugins/alias @@ -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 diff --git a/plugins/prompt b/plugins/prompt index 27d1ddb..fad24be 100644 --- a/plugins/prompt +++ b/plugins/prompt @@ -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 From 71847b3856592b810e30d6180dcd96f08a17de41 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 13 Jul 2022 22:12:39 +0300 Subject: [PATCH 3/4] tweaking.... Signed-off-by: Alex A. Naanou --- bashctrl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bashctrl b/bashctrl index c73f763..24e47fc 100755 --- a/bashctrl +++ b/bashctrl @@ -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 @@ -254,7 +259,9 @@ while true; do for plugin in ${BASH_DIR}/events/$2/* ; do [ $plugin == "README" ] \ && continue + echo " --- $plugin: pre" source $plugin $2 + echo " --- $plugin: post" done shift break From 0c513c0fd89a29f1ca38e9cb4db1ac7174edbdd0 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 13 Jul 2022 22:15:02 +0300 Subject: [PATCH 4/4] cleanup.... Signed-off-by: Alex A. Naanou --- bashctrl | 2 -- 1 file changed, 2 deletions(-) diff --git a/bashctrl b/bashctrl index 24e47fc..d7f36f0 100755 --- a/bashctrl +++ b/bashctrl @@ -259,9 +259,7 @@ while true; do for plugin in ${BASH_DIR}/events/$2/* ; do [ $plugin == "README" ] \ && continue - echo " --- $plugin: pre" source $plugin $2 - echo " --- $plugin: post" done shift break