From 52fbff80b1ebd4e44a0fd51e9c28963ecbce1d7e Mon Sep 17 00:00:00 2001 From: zegonix Date: Sat, 1 Nov 2025 11:43:13 +0100 Subject: [PATCH] (bash) moved contents of .bash_profile to a different file to avoid source loops --- bash-conf-home/.bash_paths | 22 ++++++++++++++++++++++ bash-conf-home/.bash_profile | 25 +++---------------------- bash-conf-work/.bash_paths | 26 ++++++++++++++++++++++++++ bash-conf-work/.bash_profile | 29 +++-------------------------- bashrc/.bashrc | 2 +- 5 files changed, 55 insertions(+), 49 deletions(-) create mode 100644 bash-conf-home/.bash_paths create mode 100644 bash-conf-work/.bash_paths diff --git a/bash-conf-home/.bash_paths b/bash-conf-home/.bash_paths new file mode 100644 index 0000000..844f17b --- /dev/null +++ b/bash-conf-home/.bash_paths @@ -0,0 +1,22 @@ +# +# ~/.bash_profile +# + +# KEEP THIS! +# important for window manager and menu app (fuzzel, rofi, ..) +# to find scripts and utilities + +export_paths=("${HOME}/dotfiles/scripts") +export_paths+=("$HOME/tools/jlink") + +for entry in ${export_paths[@]}; do + if ! [[ -d "${entry}" ]]; then + continue + fi + if [[ "$PATH" == *"${entry}"* ]]; then + continue + fi + export PATH="${PATH}:${entry}" +done + +unset export_paths diff --git a/bash-conf-home/.bash_profile b/bash-conf-home/.bash_profile index 844f17b..7bc56dc 100644 --- a/bash-conf-home/.bash_profile +++ b/bash-conf-home/.bash_profile @@ -1,22 +1,3 @@ -# -# ~/.bash_profile -# - -# KEEP THIS! -# important for window manager and menu app (fuzzel, rofi, ..) -# to find scripts and utilities - -export_paths=("${HOME}/dotfiles/scripts") -export_paths+=("$HOME/tools/jlink") - -for entry in ${export_paths[@]}; do - if ! [[ -d "${entry}" ]]; then - continue - fi - if [[ "$PATH" == *"${entry}"* ]]; then - continue - fi - export PATH="${PATH}:${entry}" -done - -unset export_paths +if [[ -f ~/.bashrc ]]; then + source ~/.bashrc +fi diff --git a/bash-conf-work/.bash_paths b/bash-conf-work/.bash_paths new file mode 100644 index 0000000..726d5ee --- /dev/null +++ b/bash-conf-work/.bash_paths @@ -0,0 +1,26 @@ +# +# ~/.bash_profile +# + +# KEEP THIS! +# important for window manager and menu app (fuzzel, rofi, ..) +# to find scripts and utilities + +export_paths=("${HOME}/dotfiles/scripts") +export_paths+=("$HOME/tools/Xilinx/Vivado/2021.1/bin") +export_paths+=("$HOME/tools/jlink") + +for entry in ${export_paths[@]}; do + if ! [[ -d "${entry}" ]]; then + continue + fi + if [[ "$PATH" == *"${entry}"* ]]; then + continue + fi + export PATH="${PATH}:${entry}" +done + +unset export_paths + +# vivado license +export XILINXD_LICENSE_FILE=26140@aberdeen.zhaw.ch diff --git a/bash-conf-work/.bash_profile b/bash-conf-work/.bash_profile index 726d5ee..7bc56dc 100644 --- a/bash-conf-work/.bash_profile +++ b/bash-conf-work/.bash_profile @@ -1,26 +1,3 @@ -# -# ~/.bash_profile -# - -# KEEP THIS! -# important for window manager and menu app (fuzzel, rofi, ..) -# to find scripts and utilities - -export_paths=("${HOME}/dotfiles/scripts") -export_paths+=("$HOME/tools/Xilinx/Vivado/2021.1/bin") -export_paths+=("$HOME/tools/jlink") - -for entry in ${export_paths[@]}; do - if ! [[ -d "${entry}" ]]; then - continue - fi - if [[ "$PATH" == *"${entry}"* ]]; then - continue - fi - export PATH="${PATH}:${entry}" -done - -unset export_paths - -# vivado license -export XILINXD_LICENSE_FILE=26140@aberdeen.zhaw.ch +if [[ -f ~/.bashrc ]]; then + source ~/.bashrc +fi diff --git a/bashrc/.bashrc b/bashrc/.bashrc index a749a1c..b1fb63a 100644 --- a/bashrc/.bashrc +++ b/bashrc/.bashrc @@ -94,8 +94,8 @@ fi ## source various scripts personal_scripts=${HOME}/dotfiles/scripts/ source_list=() +source_list+=("$HOME/.bash_paths") source_list+=("$HOME/.bash_alias") -source_list+=("$HOME/.bash_profile") source_list+=("${personal_scripts}/navigate_bash_setup.sh") source_list+=("${personal_scripts}/fzf-bash-history.sh") source_list+=("${personal_scripts}/colors.sh")