⚡ bath update
This commit is contained in:
+21
-16
@@ -5,46 +5,51 @@
|
||||
shopt -s checkwinsize
|
||||
|
||||
# Color support for ls and other tools
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
if [[ -x /usr/bin/dircolors ]]; then
|
||||
if [[ -r "$HOME/.dircolors" ]]; then
|
||||
eval "$(dircolors -b "$HOME/.dircolors")" 2>/dev/null || true
|
||||
else
|
||||
eval "$(dircolors -b)" 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
grep --color=auto < /dev/null &>/dev/null && \
|
||||
alias grep='grep --color=auto'
|
||||
alias diff='diff --color=auto'
|
||||
[[ -x /usr/bin/lesspipe ]] && eval "$(SHELL=/bin/sh lesspipe)" # make less more friendly for non-text input files, see lesspipe(1)
|
||||
[[ -x /usr/bin/lesspipe ]] && \
|
||||
eval "$(SHELL=/bin/sh lesspipe)" # make less more friendly for non-text input files, see lesspipe(1)
|
||||
export LS_COLORS="$LS_COLORS:tw=01;04;34:ow=01;04;34:"
|
||||
alias ls='ls --color=auto -pQFh --group-directories-first'
|
||||
if ls --color=auto /dev/null &>/dev/null; then
|
||||
alias ls='ls --color=auto -pQFh --group-directories-first'
|
||||
else
|
||||
alias ls='ls -pQFhG'
|
||||
fi
|
||||
|
||||
[[ "$-" != *i* ]] && return
|
||||
|
||||
updatePrompt() {
|
||||
updatePrompt() { # ✓ ≡1 At 12:28 by jaandrle in ~/Dokumenty/Projekty
|
||||
local -r prev_exit="$?"
|
||||
# color_helper_>>color<< (Note: \[\]= escaping)
|
||||
local -r chRst="\[\033[0m\]" #white
|
||||
local -r chR="\[\033[1;91m\]" #red
|
||||
local -r chW="\[\033[00m\]" #white
|
||||
local -r chG="\[\033[01;32m\]" #green
|
||||
local -r chB="\[\033[0;34m\]" #blue
|
||||
local -r chP="\[\033[0;35m\]" #purple
|
||||
local -r chY="\[\033[0;33m\]" #yellow
|
||||
PS1=""
|
||||
if [ "$prev_exit" -eq 0 ]; then
|
||||
PS1+="$chG✓ $chW"
|
||||
PS1+="$chG✓$chRst"
|
||||
else
|
||||
PS1+="$chR✗ $chW"
|
||||
PS1+="$chR✗$chRst"
|
||||
fi
|
||||
PS1+=" "
|
||||
local jobs
|
||||
jobs=$(jobs -p | wc -w)
|
||||
[[ "$jobs" -ne 0 ]] && PS1+="${chY}≡${jobs}${chW}"
|
||||
[[ "$jobs" -ne 0 ]] && PS1+="${chY}≡\j${chRst}"
|
||||
PS1+="${debian_chroot:+($debian_chroot)}"
|
||||
PS1+=" At ${chG}\A${chW}"
|
||||
PS1+=" by ${chP}\u${chW}"
|
||||
PS1+=" At ${chG}\A${chRst}"
|
||||
PS1+=" by ${chP}\u${chRst}"
|
||||
if sudo -n true 2>/dev/null; then
|
||||
PS1+="${chR} (sudo)${chW}"
|
||||
PS1+="${chR} (sudo)${chRst}"
|
||||
fi
|
||||
PS1+=" in "
|
||||
local -r git='command git'
|
||||
@@ -56,10 +61,10 @@ updatePrompt() {
|
||||
status="$($git for-each-ref --format='%(upstream:trackshort)' "$branch" 2>/dev/null | awk '!seen[$1]++ {printf $1}')"
|
||||
status+="$($git status --porcelain 2>/dev/null | awk '!seen[$1]++ {printf $1}')"
|
||||
[ "$status" != "" ] && \
|
||||
PS1+="|$chY$status$chW"
|
||||
PS1+="|$chY$status$chRst"
|
||||
PS1+="] "
|
||||
fi
|
||||
PS1+="${chB}\w${chW}"
|
||||
PS1+="${chB}\w${chRst}"
|
||||
PS1+="\n${PS1_jaaENV:-:}"
|
||||
|
||||
local -r hook="$BASH_DOTFILES/hooks/onprompt"
|
||||
|
||||
Reference in New Issue
Block a user