From bbaf1218569bfccc59bece1d5735f91efa6a2e8c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 12 Jun 2020 17:39:45 +0300 Subject: [PATCH] bash: Prepend memory control group to `PS1` --- .profile | 4 ++-- .shellrc | 8 ++++---- admin/prog/{short_curdir => bash_prompt} | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename admin/prog/{short_curdir => bash_prompt} (100%) diff --git a/.profile b/.profile index 07d4f98..89b65dc 100644 --- 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 \\$" diff --git a/.shellrc b/.shellrc index 6cb771f..56051ca 100644 --- 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" diff --git a/admin/prog/short_curdir b/admin/prog/bash_prompt similarity index 100% rename from admin/prog/short_curdir rename to admin/prog/bash_prompt -- 2.39.5