linux  system  bash

bash-it

Notizsammlung zum Thema Bash-it
https://github.com/Bash-it/bash-it/ 
https://bash-it.readthedocs.io/en/latest/ 

Installation

git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
~/.bash_it/install.sh

Update

bash-it update
#ggf. 'q' drücken wenn ein Changelog angezeigt wird... 

Theme

https://bash-it.readthedocs.io/en/latest/themes-list/bira/

nano ~/.bashrc 
Strg+W "theme"
export BASH_IT_THEME="m~"

Eigenes Theme

Bira Fork

mkdir ~/.bash_it/themes/m~
nano ~/.bash_it/themes/m~/m~.theme.bash
# shellcheck shell=bash
# shellcheck disable=SC2034 # Expected behavior for themes.
# bira fork

SCM_THEME_PROMPT_PREFIX=" ${yellow?}‹"
SCM_THEME_PROMPT_SUFFIX="›${reset_color?}"

VIRTUALENV_THEME_PROMPT_PREFIX=" ${cyan?}‹"
VIRTUALENV_THEME_PROMPT_SUFFIX="›${reset_color?}"

bold="\[\e[1m\]"

if [[ ${UID} -eq 0 ]]; then
	user_host="${bold_red?}\u@\h${normal?}${reset_color?}"
elif [[ "${HOSTNAME}" == "l0la59" ]]; then
	user_host="${bold_green?}\u@\h${normal?}${reset_color?}"
else
	user_host="${bold_yellow?}\u@\h${normal?}${reset_color?}"
fi

function prompt_command() {
	local current_dir=" ${bold_blue?}\w${normal?}${reset_color?}"
	local timestamp="${red?}$(date "+%Y-%m-%d %H:%M:%S") ${normal?}${reset_color?}"
	local virtualenv_prompt scm_prompt_info
	virtualenv_prompt="$(virtualenv_prompt)"
	scm_prompt_info="$(scm_prompt_info)"
	PS1="╭─${timestamp}${user_host?}${current_dir}${virtualenv_prompt}${scm_prompt_info}\n╰─ ${bold?}\\$ ${normal?}"
}

safe_append_prompt_command prompt_command

Aliases

bash-it show aliases
bash-it disable alias general

#Alle Alias deaktiviert, die brauchbaren geklaut und in meine .bash_aliases gepackt!

Hilfe zu den aliases aufrufen

bash-it help aliases

Plugins

bash-it show plugins

bash-it disable plugin all

#bash-it enable plugin history-search
#bash-it enable plugin history-substring-search
bash-it enable plugin man
bash-it enable plugin subversion
bash-it enable plugin git
bash-it enable plugin goenv
bash-it enable plugin go

Troubleshooting

bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory

sed -i 's/en_US/en_GB/g' /home/mani/.bash_it/lib/command_duration.bash