diff --git a/common/.bashrc b/common/.bashrc new file mode 100644 index 0000000..67cfb61 --- /dev/null +++ b/common/.bashrc @@ -0,0 +1,39 @@ +export DOTFILES=$(cd "$(dirname "$HOME/$(readlink $HOME/.zshenv)")" && cd .. && pwd) +source "$DOTFILES/helpers" + +cleanup_helpers + +# Load env files +for file in $DOTFILES/*/env.sh; do + if [[ "$(basename $(dirname $file))" != "zsh" ]]; then + source "$file" + fi +done + +# Load additional sh files +for file in $DOTFILES/*/*.sh; do + if [[ "$(basename $file)" != env.sh ]] && [[ "$(basename $(dirname $file))" != "zsh" ]]; then + source "$file" + fi +done + +# Set up prompt +function _prompt_command() { + local retval=$? + local red="\[$(tput setaf 1)\]" + local green="\[$(tput setaf 2)\]" + local blue="\[$(tput setaf 4)\]" + local reset="\[$(tput sgr0)\]" + PS1="" + if [[ $retval -ne 0 ]]; then + PS1+="$red$retval$reset " + fi + PS1+="$green\u$reset " + PS1+="$blue\W$reset $ " +} +export PROMPT_COMMAND=_prompt_command + +# Load .local file at the end for post configurations +if [ -e "$HOME/.bashrc.local" ]; then + source "$HOME/.bashrc.local" +fi diff --git a/common/aliases.sh b/common/aliases.sh index d33e93c..0cb6fd9 100644 --- a/common/aliases.sh +++ b/common/aliases.sh @@ -17,4 +17,4 @@ alias path='echo -e ${PATH//:/\\n}' function dotf { (cd $DOTFILES && "$@"); } -function touch { mkdir $(dirname "$1") && command touch "$1" } +function touch { mkdir $(dirname "$1") && command touch "$1"; } diff --git a/macos/.config/yabai/yabairc b/macos/.config/yabai/yabairc index b39f617..725f755 100755 --- a/macos/.config/yabai/yabairc +++ b/macos/.config/yabai/yabairc @@ -11,7 +11,6 @@ yabai -m config window_placement second_child yabai -m config window_topmost off yabai -m config window_shadow off yabai -m config window_opacity on -yabai -m config window_opacity_duration 0.0 yabai -m config active_window_opacity 1.0 yabai -m config normal_window_opacity 0.75 yabai -m config window_border on diff --git a/macos/cleanup.sh b/macos/cleanup.sh index edc9539..f483df0 100644 --- a/macos/cleanup.sh +++ b/macos/cleanup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env false -if [[ "$OS" == macos ]] && type /usr/local/bin/brew &>/dev/null; then +if [[ "$OS" == macos ]] && type brew &>/dev/null; then # Restore unset -f /usr/libexec/path_helper fi diff --git a/macos/env.sh b/macos/env.sh index a29d3e0..60aa847 100644 --- a/macos/env.sh +++ b/macos/env.sh @@ -11,5 +11,5 @@ if [[ "$OS" == macos ]] && type /usr/local/bin/brew &>/dev/null; then export HOMEBREW_CASK_OPTS="--appdir=~/Applications" # MacOS calls this in zprofile, temporarily hijack it - function /usr/libexec/path_helper {} + function /usr/libexec/path_helper() { :; } fi diff --git a/zsh/.zshenv b/zsh/.zshenv index c3e9054..0d5f7fd 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -5,7 +5,7 @@ cleanup_helpers # Load env files typeset -U config_files -config_files=($DOTFILES/**/*.sh) +config_files=($DOTFILES/*/*.sh) for file in ${(M)config_files:#*/env.sh}; do source "$file" done diff --git a/zsh/.zshrc b/zsh/.zshrc index ec9db64..d9ddf2c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -40,7 +40,7 @@ if (( $+commands[antibody] )); then fi fi -# Load additional zsh files +# Load additional sh files typeset -U config_files config_files=($DOTFILES/*/*.sh) for file in ${config_files:#*/env.sh}; do