Set the custom bin path within a dedicated script

The custom bin path was set in multiple places. Each time, the line
was identical and supposed the use of a /bin/sh emulation with a
common extension. To reduce duplicated code and support other
platforms, the custom bin path is now set in a dedicated script that
can be source'd.
This commit is contained in:
Rodolphe Breard 2017-02-12 16:09:16 +01:00
parent e24502769b
commit 01472b6d05
5 changed files with 12 additions and 5 deletions

View file

@ -14,7 +14,9 @@ export PAGER='less'
export USER_NICKNAME="Rodolphe Breard" export USER_NICKNAME="Rodolphe Breard"
export DEBEMAIL="packages+deb@what.tf" export DEBEMAIL="packages+deb@what.tf"
export DEBFULLNAME="$USER_NICKNAME" export DEBFULLNAME="$USER_NICKNAME"
[[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH"
# Path
[ -f ~/.setpath.sh ] && . ~/.setpath.sh
# Colors # Colors
[ "$CLICOLOR" -ne 0 ] && hash dircolors 2>/dev/null && eval $(dircolors -b) [ "$CLICOLOR" -ne 0 ] && hash dircolors 2>/dev/null && eval $(dircolors -b)

4
.setpath.sh Normal file
View file

@ -0,0 +1,4 @@
BIN_PATH="$HOME/bin"
found=$(echo $PATH | tr ':' '\n' | grep -w "$BIN_PATH")
[ ! "$found" ] && export PATH="$BIN_PATH:$PATH"
true

View file

@ -1,7 +1,7 @@
[ -f ~/.xprofile ] && . ~/.xprofile [ -f ~/.xprofile ] && . ~/.xprofile
[ -f ~/.setpath.sh ] && . ~/.setpath.sh
DEFAULT_SESSION=qtile DEFAULT_SESSION=qtile
[[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH"
case "$1" in case "$1" in
awesome) awesome)

View file

@ -1,5 +1,6 @@
[ -f /etc/xprofile ] && . /etc/xprofile [ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.Xresources ] && xrdb -merge ~/.Xresources [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
[ -f ~/.setpath.sh ] && . ~/.setpath.sh
setxkbmap -option compose:menu setxkbmap -option compose:menu
setxkbmap -option compose:rwin setxkbmap -option compose:rwin
@ -7,5 +8,3 @@ setxkbmap -option compose:rwin
hash xcompmgr 2>/dev/null && xcompmgr & hash xcompmgr 2>/dev/null && xcompmgr &
hash xscreensaver 2>/dev/null && xscreensaver -no-splash & hash xscreensaver 2>/dev/null && xscreensaver -no-splash &
hash gpg-agent 2>/dev/null && eval $(gpg-agent --daemon --enable-ssh-support) hash gpg-agent 2>/dev/null && eval $(gpg-agent --daemon --enable-ssh-support)
[[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH"

4
.zshrc
View file

@ -11,7 +11,9 @@ export PAGER='less'
export USER_NICKNAME="Rodolphe Breard" export USER_NICKNAME="Rodolphe Breard"
export DEBEMAIL="packages+deb@what.tf" export DEBEMAIL="packages+deb@what.tf"
export DEBFULLNAME="$USER_NICKNAME" export DEBFULLNAME="$USER_NICKNAME"
[[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH"
# Path
[ -f ~/.setpath.sh ] && . ~/.setpath.sh
# Colors # Colors
[ "$CLICOLOR" -ne 0 ] && hash dircolors 2>/dev/null && eval $(dircolors -b) [ "$CLICOLOR" -ne 0 ] && hash dircolors 2>/dev/null && eval $(dircolors -b)