diff options
Diffstat (limited to '.bashrc')
-rw-r--r-- | .bashrc | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -61,21 +61,22 @@ disk_usage=$(df | grep /dev/sdb3 | awk '{print $5}') function aa_prompt_defaults() { local colors=$(tput colors 2>/dev/null || echo -n 1) C= - if [[ $colors -ge 256 ]]; then - C="$(tput setaf 33 2>/dev/null)" - AA_P='mf=x mt=x n=0; while [[ $n < 1 ]];do read a mt a; read a mf a; (( n++ )); done</proc/meminfo; export AA_PP="\033[38;5;2m"$((mf/1024))/"\033[38;5;89m"$((mt/1024))MB--$disk_usage; unset -v mf mt n a' - else - C="$(tput setaf 4 2>/dev/null)" - AA_P='mf=x mt=x n=0; while [[ $n < 1 ]];do read a mt a; read a mf a; (( n++ )); done</proc/meminfo; export AA_PP="\033[92m"$((mf/1024))/"\033[32m"$((mt/1024))MB--$disk_usage; unset -v mf mt n a' - fi + # if [[ $colors -ge 256 ]]; then + # C="$(tput setaf 33 2>/dev/null)" + # AA_P='mf=x mt=x n=0; while [[ $n < 1 ]];do read a mt a; read a mf a; (( n++ )); done</proc/meminfo; 5;2m";5;89m"; unset -v mf mt n a' + # else + # C="$(tput setaf 4 2>/dev/null)" + # AA_P='mf=x mt=x n=0; while [[ $n < 1 ]];do read a mt a; read a mf a; (( n++ )); done</proc/meminfo; unset -v mf mt n a' + # fi - eval $AA_P + # eval $AA_P PROMPT_COMMAND='stty echo; history -a; echo -en "\e[34h\e[?25h"; (($SECONDS % 2==0 )) && eval $AA_P; echo -en "$AA_PP";' SSH_TTY=${SSH_TTY:-$(tty 2>/dev/null || readlink /proc/$$/fd/0 2>/dev/null)} PS1="\[\e[m\n\e[1;38m\][\$\$:\$PPID \j:\!\[\e[1;38m\]]\[\e[0;36m\] \T \d \[\e[1;34m\][${C}\u@\H\[\e[1;34m\]:\[\e[0;37m\]${SSH_TTY/\/dev\//} \[\e[0;37m\]+${SHLVL}\[\e[1;34m\]] \[\e[1;37m\]\w\[\e[0;37m\]\n\\$ " - export PS1 AA_P PROMPT_COMMAND SSH_TTY + # export PS1 AA_P PROMPT_COMMAND SSH_TTY + export PS1 PROMPT_COMMAND SSH_TTY } aa_prompt_defaults |