]> git.phdru.name Git - dotfiles.git/commitdiff
bash: Prepend memory control group to `PS1`
authorOleg Broytman <phd@phdru.name>
Fri, 12 Jun 2020 14:39:45 +0000 (17:39 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 12 Jun 2020 14:53:05 +0000 (17:53 +0300)
.profile
.shellrc
admin/prog/bash_prompt [moved from admin/prog/short_curdir with 100% similarity]

index 07d4f98ced6178296619baaf9824deb83aebf034..89b65dc3c6b58e03234e43ac0dba93c9e830cc65 100644 (file)
--- a/.profile
+++ b/.profile
@@ -192,8 +192,8 @@ if [ -t 0 ] ; then
          ;;
       esac
 
-      if [ -r "$HOME"/admin/prog/short_curdir ]; then
-         . "$HOME"/admin/prog/short_curdir
+      if [ -r "$HOME"/admin/prog/bash_prompt ]; then
+         . "$HOME"/admin/prog/bash_prompt
          OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\${HOSTNAME::5} \`short_curdir\` \\$"
       else
          OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \W \\$"
index 6cb771f2d0824c3f32514a33b3bbdaf8bd2ba7fa..56051caf9037a6da929c2c19f94619e117e0aeee 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -15,8 +15,6 @@ esac
 # Stop if non-interactive shell
 [ -z "$PS1" ] && return
 
-PS1="$OPS1$SHLVL "
-
 if test -n "$BASH_VERSION"; then
    # append to the history file, don't overwrite it
    shopt -s histappend
@@ -153,10 +151,12 @@ if test -n "$BASH_VERSION"; then
    complete -W "`echo $BROWSER | sed 's/:/ /g'`" start-browser
 
    if [ "`type -t short_curdir`" != function -a \
-         -r "$HOME"/admin/prog/short_curdir ]; then
-      . "$HOME"/admin/prog/short_curdir
+         -r "$HOME"/admin/prog/bash_prompt ]; then
+      . "$HOME"/admin/prog/bash_prompt
    fi
 
+   PS1="\`cgmem_which_prompt\`$OPS1$SHLVL "
+
    #if type -p pip >/dev/null 2>&1; then
    #   eval "`pip completion --bash`"
    #   rm -rf /tmp/pip_build_"$USER"