2
0
Fork 0

/etc/skel/.bashrc: various changes

main
Ducky 2022-01-25 11:49:18 +00:00
parent 379555e1c3
commit 6f8a109a89
1 changed files with 12 additions and 13 deletions

View File

@ -11,12 +11,11 @@ case $- in
*) return;;
esac
# Various options
# Shell customization
[[ -z $ZIO_SHELL_CARET ]] && ZIO_SHELL_CARET="➜ "
# Bash options
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s checkwinsize
# Helpers
function color() {
@ -49,9 +48,9 @@ function print_header() {
echo " "
if [[ $USER == "root" ]]; then
echo -e "$(color 33 1) 🔥 Here be dragons.$(color)"
echo -e "$(color 33 1) 🔥 Here be dragons.$(color)"
else
echo -e " 👋 Hello $(color 33 1)$USER$(color), I am $(color 33 1)$(hostname -f)$(color)."
echo -e " 👋 Hello $(color 33 1)$USER$(color), I am $(color 33 1)$(hostname -f)$(color)."
fi
echo " "
@ -72,10 +71,10 @@ case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# Make less friendly for non-text input files
# less: make friendly for non-text input files
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# Color support for ls
# ls: color support
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
@ -87,19 +86,19 @@ if [ -x /usr/bin/dircolors ]; then
alias egrep='egrep --color=auto'
fi
# Sexy prompt
# Prompt
if [ "$color_prompt" = yes ]; then
PS1="\[$(color 32 1)\]\h\[$(color 37)\]:\[$(color 32 1)\]\W\[$(color 37)\] \[$(color $(get_caret_color))\] \[$(color)\] "
PS1="\[$(color 32 1)\]\h\[$(color 37)\]:\[$(color 32 1)\]\W\[$(color 37)\] \[$(color $(get_caret_color))\]$ZIO_SHELL_CARET \[$(color)\] "
else
PS1="\h:\W > "
fi
# Source aliases (instead of editing your ~/.bashrc!)
# Aliases
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# Source bash completions
# Completions
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion