diff --git a/.bashrc b/.bashrc index 905f2f6..2b46985 100644 --- a/.bashrc +++ b/.bashrc @@ -14,7 +14,9 @@ export PAGER='less' export USER_NICKNAME="Rodolphe Breard" export DEBEMAIL="packages+deb@what.tf" export DEBFULLNAME="$USER_NICKNAME" -[[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH" + +# Path +[ -f ~/.setpath.sh ] && . ~/.setpath.sh # Colors [ "$CLICOLOR" -ne 0 ] && hash dircolors 2>/dev/null && eval $(dircolors -b) diff --git a/.setpath.sh b/.setpath.sh new file mode 100644 index 0000000..defa517 --- /dev/null +++ b/.setpath.sh @@ -0,0 +1,4 @@ +BIN_PATH="$HOME/bin" +found=$(echo $PATH | tr ':' '\n' | grep -w "$BIN_PATH") +[ ! "$found" ] && export PATH="$BIN_PATH:$PATH" +true diff --git a/.xinitrc b/.xinitrc index 69b8022..b9eb3b5 100755 --- a/.xinitrc +++ b/.xinitrc @@ -1,7 +1,7 @@ [ -f ~/.xprofile ] && . ~/.xprofile +[ -f ~/.setpath.sh ] && . ~/.setpath.sh DEFAULT_SESSION=qtile -[[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH" case "$1" in awesome) diff --git a/.xprofile b/.xprofile index 604562f..c1456e3 100644 --- a/.xprofile +++ b/.xprofile @@ -1,5 +1,6 @@ [ -f /etc/xprofile ] && . /etc/xprofile [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources +[ -f ~/.setpath.sh ] && . ~/.setpath.sh setxkbmap -option compose:menu setxkbmap -option compose:rwin @@ -7,5 +8,3 @@ setxkbmap -option compose:rwin hash xcompmgr 2>/dev/null && xcompmgr & hash xscreensaver 2>/dev/null && xscreensaver -no-splash & hash gpg-agent 2>/dev/null && eval $(gpg-agent --daemon --enable-ssh-support) - -[[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH" diff --git a/.zshrc b/.zshrc index 6706102..3a0e56e 100644 --- a/.zshrc +++ b/.zshrc @@ -11,7 +11,9 @@ export PAGER='less' export USER_NICKNAME="Rodolphe Breard" export DEBEMAIL="packages+deb@what.tf" export DEBFULLNAME="$USER_NICKNAME" -[[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH" + +# Path +[ -f ~/.setpath.sh ] && . ~/.setpath.sh # Colors [ "$CLICOLOR" -ne 0 ] && hash dircolors 2>/dev/null && eval $(dircolors -b)