diff --git a/bash/.bash_profile b/bash/.bash_profile index c6c4f2a..483d4e6 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -10,19 +10,33 @@ export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"} # load global sh env vars [ -f "$XDG_CONFIG_HOME/sh/env" ] && source "$XDG_CONFIG_HOME/sh/env" if [ -d "$XDG_CONFIG_HOME/sh/env.d" ]; then - for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do - . "$_env" - done - unset _env + for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do + . "$_env" + done + unset _env +fi +[ -f "$XDG_CONFIG_HOME/bash/env" ] && source "$XDG_CONFIG_HOME/bash/env" +if [ -d "$XDG_CONFIG_HOME/bash/env.d" ]; then + for _env in "$XDG_CONFIG_HOME/bash/env.d"/*.sh; do + . "$_env" + done + unset _env fi # load profile files vars [ -f "$XDG_CONFIG_HOME/sh/profile" ] && source "$XDG_CONFIG_HOME/sh/profile" if [ -d "$XDG_CONFIG_HOME/sh/profile.d" ]; then - for _profile in "$XDG_CONFIG_HOME/sh/profile.d"/*.sh; do - . "$_profile" - done - unset _profile + for _profile in "$XDG_CONFIG_HOME/sh/profile.d"/*.sh; do + . "$_profile" + done + unset _profile +fi +[ -f "$XDG_CONFIG_HOME/bash/profile" ] && source "$XDG_CONFIG_HOME/bash/profile" +if [ -d "$XDG_CONFIG_HOME/bash/profile.d" ]; then + for _profile in "$XDG_CONFIG_HOME/bash/profile.d"/*.sh; do + . "$_profile" + done + unset _profile fi # shellcheck disable=SC1090 diff --git a/bash/.bashrc b/bash/.bashrc index 28ee5e6..230b896 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # # ~/.bashrc # diff --git a/bash/.config/bash/env.d/bash-history-xdg.sh b/bash/.config/bash/env.d/bash-history-xdg.sh new file mode 100644 index 0000000..4484941 --- /dev/null +++ b/bash/.config/bash/env.d/bash-history-xdg.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +export HISTFILE="${XDG_STATE_HOME}/bash/history" + +# bashrc, bash_profile, bash_logout currently unsupported +# see https://savannah.gnu.org/support/?108134