remove mrled's custom prompt and dependencies
I was unable to get his prompt to work. Added babbies first prompt as a replacement and removed what I didn't need from the repo.
This commit is contained in:
parent
b713a13983
commit
497cf26a02
106
.bashrc
106
.bashrc
@ -9,11 +9,8 @@ shopt -s histappend
|
||||
# fix line wrap issues
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
# find paths inside agares
|
||||
export AGARES=${AGARES:-"$HOME/.agares"}
|
||||
|
||||
# blatantly steal micah's ls aliases because they make SO MUCH SENSE omg.
|
||||
alias lsa='ls -a'
|
||||
@ -57,40 +54,6 @@ if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color) color_prompt=yes;;
|
||||
esac
|
||||
|
||||
force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
else
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
@ -103,67 +66,4 @@ if [ -x /usr/bin/dircolors ]; then
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
ansi_reset=$(ansi mode=reset)
|
||||
ansi_bold=$(ansi mode=bold)
|
||||
ansi_fg_white=$(ansi fg=white)
|
||||
ansi_fg_green=$(ansi fg=green)
|
||||
ansi_fg_gray=$(ansi mode=unbold fg=white)
|
||||
ansi_fg_red=$(ansi fg=red)
|
||||
ansi_fg_blue=$(ansi fg=blue)
|
||||
ansi_fg_magenta=$(ansi fg=magenta)
|
||||
bashprompt() {
|
||||
# Gather the exit code first, in case something resets it
|
||||
exitcoderaw="$?"
|
||||
|
||||
# Save the shell's history
|
||||
history -a
|
||||
|
||||
# Reset any previous settings, in case last output did not
|
||||
init="\[${ansi_reset}\]"
|
||||
|
||||
dateraw='\t'
|
||||
date="\[${ansi_bold}${ansi_fg_white}\]${dateraw}\[${ansi_reset}\]"
|
||||
|
||||
if test "$exitcoderaw" -eq 0 || test -z "$exitcoderaw"; then
|
||||
# Covers a case where no command has been previously executed
|
||||
exitcoderaw=0
|
||||
exitcodecolor="$ansi_fg_gray"
|
||||
else
|
||||
exitcodecolor="$ansi_fg_red"
|
||||
fi
|
||||
exitcode="\[${exitcodecolor}\]E${exitcoderaw}\[${ansi_reset}\]"
|
||||
|
||||
# Allow setting PROMPT_HOSTNAME_OVERRIDE for situations where the hostname
|
||||
# is not a useful way to identify the host
|
||||
# For instance, the hostname may be automatically generated by Docker
|
||||
hostnameraw="${PROMPT_HOSTNAME_OVERRIDE:-"\\h"}"
|
||||
hostname="\[${ansi_bold}${ansi_fg_blue}\]$hostnameraw\[$ansi_reset\]"
|
||||
|
||||
jobcountraw=$(jobs | wc -l | sed 's/ *//g')
|
||||
if test "$jobcountraw" -gt 0 2> /dev/null; then
|
||||
jobcountcolor="$ansi_fg_magenta"
|
||||
else
|
||||
jobcountcolor="$ansi_fg_gray"
|
||||
fi
|
||||
jobcount="\[${jobcountcolor}\]J${jobcountraw}\[${ansi_reset}\]"
|
||||
|
||||
workdirraw='\W'
|
||||
workdir="\[${ansi_fg_green}\]${workdirraw}\[${ansi_reset}\]"
|
||||
|
||||
# lcop = last character of prompt
|
||||
# Use bash's $EUID variable to avoid having to shell out to 'id'
|
||||
lcopraw='>'
|
||||
if test "$EUID" -eq 0; then
|
||||
lcopraw='#'
|
||||
fi
|
||||
lcop="\[${ansi_bold}${ansi_fg_blue}\]${lcopraw}\[${ansi_reset}\]"
|
||||
|
||||
export PS1="${init}${date} ${exitcode} ${hostname} ${jobcount} ${workdir} ${lcop} "
|
||||
}
|
||||
export PROMPT_COMMAND=bashprompt
|
||||
|
||||
if test -d "$HOME/.bashrc.d"; then
|
||||
for script in $(find "$HOME/.bashrc.d" -type f); do
|
||||
. "$script"
|
||||
done
|
||||
fi
|
||||
export PS1="\t:\[$(tput sgr0)\]\[\033[38;5;93m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;6m\][\w]:\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
|
Loading…
Reference in New Issue
Block a user