From 354a411dedb97be7eb6e599a1e609e84b91aa18a Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Thu, 12 Jan 2023 19:13:58 +0000 Subject: [PATCH] Update 3 files - /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl - /home/dot_bashrc - /software.yml --- .../run_onchange_after_94-bash-it.tmpl | 26 ++++++++--- home/dot_bashrc | 43 ++++++++----------- software.yml | 6 +++ 3 files changed, 44 insertions(+), 31 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl index 5e617cab..8a0e56ad 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl @@ -4,12 +4,28 @@ {{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/logg" }} +### Ensure Powerline is installed +if ! command -v powerline > /dev/null; then + install-software powerline +fi + ### Bash-it completions / plugins -if command -v bash-it; then - logg info 'Enabling bash-it completions' - bash-it enable completion defaults dirs docker docker-compose export git makefile ng npm ssh system vagrant - logg info 'Enabling bash-it plugins' - bash-it enable plugin base blesh browser cht-sh dirs gitstatus powerline sudo xterm +if command -v powerline > /dev/null; then + if command -v bash-it > /dev/null; then + if [ -n "$BASH_IT" ]; then + cd "$BASH_IT" || logg warn "The $BASH_IT directory does not exist" + logg info 'Enabling bash-it completions' + yes | bash-it enable completion defaults dirs docker docker-compose export git makefile ng npm ssh system vagrant + logg info 'Enabling bash-it plugins' + yes | bash-it enable plugin base blesh browser cht-sh dirs gitstatus powerline sudo xterm + else + logg warn 'The BASH_IT variable needs to be defined' + fi + else + logg warn '`bash-it` is not available' + fi +else + logg warn '`powerline` is not available' fi {{ end -}} diff --git a/home/dot_bashrc b/home/dot_bashrc index 3074b4a1..f0d1c61b 100644 --- a/home/dot_bashrc +++ b/home/dot_bashrc @@ -23,8 +23,24 @@ if [ -f "$HOME/.config/shell/profile.sh" ]; then . "$HOME/.config/shell/profile.sh" fi -# Prompt (on bash only) +### Fig / LC_ALL if [ "$BASH_SUPPORT" = 'true' ]; then + if [ -f "$HOME/.fig/shell/bashrc.pre.bash" ]; then + . "$HOME/.fig/shell/bashrc.pre.bash" + fi +fi + +### History +export HISTFILE="$XDG_STATE_HOME/bash/history" + +### /etc/bashrc +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +### Bash Initialization Hooks +if [ "$BASH_SUPPORT" = 'true' ]; then + # Prompt (on bash only) if [[ "$(hostname)" != *'-minimal' ]]; then ### Styled Terminal export BASH_IT="$HOME/.local/bash_it" @@ -48,32 +64,7 @@ if [ "$BASH_SUPPORT" = 'true' ]; then eval "$(oh-my-posh init bash --config "$XDG_CONFIG_HOME/oh-my-posh/Betelgeuse-minimal.omp.json")" fi fi -fi -### Fig / LC_ALL -if [ "$BASH_SUPPORT" = 'true' ]; then - if [ -f "$HOME/.fig/shell/bashrc.pre.bash" ]; then - . "$HOME/.fig/shell/bashrc.pre.bash" - fi -fi - -### Settings -if command -v shopt > /dev/null; then - shopt -s globstar - shopt -s histappend - shopt -s checkwinsize -fi - -### History -export HISTFILE="$XDG_STATE_HOME/bash/history" - -### /etc/bashrc -if [ -f /etc/bashrc ]; then - . /etc/bashrc -fi - -### Bash Initialization Hooks -if [ "$BASH_SUPPORT" = 'true' ]; then ### Bash Completion if [ -f "/usr/local/etc/profile.d/bash_completion.sh" ]; then . "/usr/local/etc/profile.d/bash_completion.sh" diff --git a/software.yml b/software.yml index d424749d..d887970f 100644 --- a/software.yml +++ b/software.yml @@ -3702,6 +3702,12 @@ softwarePackages: edex-ui: _desc: null appimage: edex-ui + powerline: + _bin: powerline + apt: powerline + dnf: powerline + pacman: powerline + pipx: powerline-status handlr: _bin: handlr _desc: A better xdg-utils