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