From da79188cd71ba3b0bdd6bc17b97aa603c5926680 Mon Sep 17 00:00:00 2001 From: Proctor Date: Fri, 19 Jun 2026 15:49:56 -0500 Subject: [PATCH] bash: profile updates --- .bash_profile | 4 ++-- .bashrc | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.bash_profile b/.bash_profile index 2165fa6..7a5fb8b 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,7 +1,5 @@ shopt -s globstar -[[ -f ~/.bashrc ]] && . ~/.bashrc - PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH" PATH=/usr/local/sbin:/usr/local/bin:~/bin:/usr/local/share/npm/bin:$PATH export PATH=$PATH:$HOME @@ -114,3 +112,5 @@ export LESS_TERMCAP_us=$'\e'"[1;32m" [ -s "$HOME/.config/broot/launcher/bash/br" ] && source "$HOME/.config/broot/launcher/bash/br" # source /Users/proctor/.config/broot/launcher/bash/br +# +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/.bashrc b/.bashrc index daeea94..faeb24b 100644 --- a/.bashrc +++ b/.bashrc @@ -1,21 +1,19 @@ # Test for an interactive shell. There is no need to set anything # past this point for scp and rcp, and it's important to refrain from # outputting anything in those cases. -if [[ $- != *i* ]] ; then +if [[ $- != *i* ]]; then # Shell is non-interactive. Be done now! return fi - # came from Aaron Lasseigne (AaronLasseigne on GitHub) -battery_status() -{ +battery_status() { HEART='♥ ' NON='\[\e[0m\]' RED='\[\e[0;31m\]' - battery_info=`ioreg -rc AppleSmartBattery` + battery_info=$(ioreg -rc AppleSmartBattery) current_charge=$(echo $battery_info | grep -o '"CurrentCapacity" = [0-9]\+' | cut -d ' ' -f 3) total_charge=$(echo $battery_info | grep -o '"MaxCapacity" = [0-9]\+' | cut -d ' ' -f 3) @@ -25,11 +23,11 @@ battery_status() fi echo -n "${RED}" - for i in `seq 1 $charged_slots`; do echo -n "$HEART"; done + for i in $(seq 1 $charged_slots); do echo -n "$HEART"; done echo -n "${NON}" if [[ $charged_slots -lt 10 ]]; then - for i in `seq 1 $(echo "10-$charged_slots" | bc)`; do echo -n "$HEART"; done + for i in $(seq 1 $(echo "10-$charged_slots" | bc)); do echo -n "$HEART"; done fi } @@ -41,3 +39,7 @@ export XML_CATALOG_FILES=/usr/local/etc/xml/catalog export PATH="$PATH:$HOME/.rvm/bin" # source ~/.config/broot/launcher/bash/br + +if which direnv 2>/dev/null; then + eval "$(direnv hook bash)" +fi