profile: Set PATH near the beginning
This way adding a command to, say, the hackpool will be taken into account in the later settings.master
parent
e211af6ce9
commit
f663dad59a
68
.profile
68
.profile
|
@ -2,13 +2,14 @@
|
||||||
## This file should be automatically sourced by the login manager. We source it
|
## This file should be automatically sourced by the login manager. We source it
|
||||||
## manually from shell rc files to make sure it works in TTY as well
|
## manually from shell rc files to make sure it works in TTY as well
|
||||||
|
|
||||||
## Preliminary definitions.
|
## Mask
|
||||||
|
## Result for 027 is: rwxr-x---
|
||||||
|
umask 027
|
||||||
|
|
||||||
## Note that it is important for MANPATH to have an empty entry to keep
|
|
||||||
## searching in the default db path. Same for INFOPATH, which should have an
|
|
||||||
## empty entry at the end, otherwise Emacs will not use standard locations. For
|
## Preliminary path definitions. For security reasons (and bad programming
|
||||||
## security reasons (and bad programming assumptions) you should always append
|
## assumptions) you should always append entries to PATH, not prepend them.
|
||||||
## entries to PATH, not prepend them.
|
|
||||||
appendpath () {
|
appendpath () {
|
||||||
[ $# -eq 2 ] && PATHVAR=$2 || PATHVAR=PATH
|
[ $# -eq 2 ] && PATHVAR=$2 || PATHVAR=PATH
|
||||||
[ -d "$1" ] || return
|
[ -d "$1" ] || return
|
||||||
|
@ -22,11 +23,8 @@ prependpath () {
|
||||||
eval export $PATHVAR="$1:\$$PATHVAR"
|
eval export $PATHVAR="$1:\$$PATHVAR"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
## Use this to override system executables.
|
||||||
|
prependpath "${HOME}/personal/hackpool"
|
||||||
## Mask
|
|
||||||
## Result for 027 is: rwxr-x---
|
|
||||||
umask 027
|
|
||||||
|
|
||||||
## TeXlive
|
## TeXlive
|
||||||
TEXDIR="${TEXDIR:-/usr/local/texlive}"
|
TEXDIR="${TEXDIR:-/usr/local/texlive}"
|
||||||
|
@ -36,10 +34,14 @@ if [ -d "${TEXDIR}" ]; then
|
||||||
TEXFOLDER="${TEXDIR}/${TEXYEAR}/bin/${TEXDISTRO}"
|
TEXFOLDER="${TEXDIR}/${TEXYEAR}/bin/${TEXDISTRO}"
|
||||||
if [ -d "${TEXFOLDER}" ]; then
|
if [ -d "${TEXFOLDER}" ]; then
|
||||||
appendpath $TEXFOLDER
|
appendpath $TEXFOLDER
|
||||||
|
## Same for INFOPATH, which should have an empty entry
|
||||||
|
## at the end, otherwise Emacs will not use standard locations.
|
||||||
prependpath ${TEXDIR}/${TEXYEAR}/texmf/doc/info INFOPATH
|
prependpath ${TEXDIR}/${TEXYEAR}/texmf/doc/info INFOPATH
|
||||||
|
|
||||||
## BSD uses 'manpath' utility, so MANPATH variable may be empty.
|
|
||||||
if [ "$(uname -o)" = "GNU/Linux" ]; then
|
if [ "$(uname -o)" = "GNU/Linux" ]; then
|
||||||
|
## Under GNU/Linux, MANPATH must contain one empty entry for 'man' to
|
||||||
|
## lookup the default database. Since BSD uses 'manpath' utility, the
|
||||||
|
## MANPATH variable is not needed.
|
||||||
prependpath ${TEXDIR}/${TEXYEAR}/texmf/doc/man MANPATH
|
prependpath ${TEXDIR}/${TEXYEAR}/texmf/doc/man MANPATH
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -61,6 +63,21 @@ if [ -d "$PLAN9DIR" ]; then
|
||||||
fi
|
fi
|
||||||
unset PLAN9DIR
|
unset PLAN9DIR
|
||||||
|
|
||||||
|
## Go
|
||||||
|
if [ -d "$HOME/go" ]; then
|
||||||
|
export GOPATH=~/go:~/.go-tools
|
||||||
|
appendpath "$HOME/.go-tools/bin"
|
||||||
|
appendpath "$HOME/go/bin"
|
||||||
|
command -v godoc >/dev/null 2>&1 && godoc -http :6060 -play 2>/dev/null &
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Last PATH entries.
|
||||||
|
appendpath "/usr/lib/surfraw"
|
||||||
|
appendpath "${HOME}/personal/games/launchers"
|
||||||
|
appendpath "${HOME}/.scripts"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Less config. -R is needed for lesspipe colorization.
|
## Less config. -R is needed for lesspipe colorization.
|
||||||
# export LESS=' -R '
|
# export LESS=' -R '
|
||||||
## Make 'less' more friendly for non-text input files, see lesspipe(1).
|
## Make 'less' more friendly for non-text input files, see lesspipe(1).
|
||||||
|
@ -75,7 +92,6 @@ export MANWIDTH=80
|
||||||
## an empty prompt. Sadly this gets messy with 'apropos'.
|
## an empty prompt. Sadly this gets messy with 'apropos'.
|
||||||
# export MANPAGER="less -sP '?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. .byte %bB?s/%s. ?e(END) :?pB%pB\%..%t'"
|
# export MANPAGER="less -sP '?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. .byte %bB?s/%s. ?e(END) :?pB%pB\%..%t'"
|
||||||
|
|
||||||
|
|
||||||
## Time display (with ls command for example)
|
## Time display (with ls command for example)
|
||||||
## TODO: BSD version?
|
## TODO: BSD version?
|
||||||
export TIME_STYLE=+"|%Y-%m-%d %H:%M:%S|"
|
export TIME_STYLE=+"|%Y-%m-%d %H:%M:%S|"
|
||||||
|
@ -87,6 +103,7 @@ if command -v ssh-agent >/dev/null 2>&1 && [ -z "$SSH_AGENT_PID" ]; then
|
||||||
command -v sessionclean >/dev/null 2>&1 && trap 'sessionclean' 0
|
command -v sessionclean >/dev/null 2>&1 && trap 'sessionclean' 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Linux specific
|
||||||
if [ "$(uname -o)" = "GNU/Linux" ] ; then
|
if [ "$(uname -o)" = "GNU/Linux" ] ; then
|
||||||
## Startup error log.
|
## Startup error log.
|
||||||
## dmesg
|
## dmesg
|
||||||
|
@ -112,22 +129,9 @@ if [ "$(uname -o)" = "GNU/Linux" ] ; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Set TEMP dir if you want to override /tmp for some applications that check
|
|
||||||
## for this variable. Usually not a good idea since some applications will write
|
|
||||||
## junk files in it.
|
|
||||||
# [ -d "$HOME/temp" ] && export TEMP="$HOME/temp"
|
|
||||||
|
|
||||||
## Wine DLL override. This removes the annoying messages for Mono and Gecko.
|
## Wine DLL override. This removes the annoying messages for Mono and Gecko.
|
||||||
export WINEDLLOVERRIDES="mscoree,mshtml="
|
export WINEDLLOVERRIDES="mscoree,mshtml="
|
||||||
|
|
||||||
## Go
|
|
||||||
if [ -d "$HOME/go" ]; then
|
|
||||||
export GOPATH=~/go:~/.go-tools
|
|
||||||
appendpath "$HOME/.go-tools/bin"
|
|
||||||
appendpath "$HOME/go/bin"
|
|
||||||
command -v godoc >/dev/null 2>&1 && godoc -http :6060 -play 2>/dev/null &
|
|
||||||
fi
|
|
||||||
|
|
||||||
## fzf
|
## fzf
|
||||||
if command -v fzf >/dev/null 2>&1; then
|
if command -v fzf >/dev/null 2>&1; then
|
||||||
export FZF_DEFAULT_OPTS="\
|
export FZF_DEFAULT_OPTS="\
|
||||||
|
@ -170,19 +174,11 @@ if command -v fzf >/dev/null 2>&1; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## pacman abs
|
## Pacman asp root.
|
||||||
if command -v asp >/dev/null 2>&1; then
|
if command -v asp >/dev/null 2>&1; then
|
||||||
export ASPROOT="$HOME/.cache/asp"
|
export ASPROOT="$HOME/.cache/asp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
## Last PATH entries.
|
|
||||||
appendpath "/usr/lib/surfraw"
|
|
||||||
appendpath "${HOME}/personal/games/launchers"
|
|
||||||
appendpath "${HOME}/.scripts"
|
|
||||||
prependpath "${HOME}/personal/hackpool"
|
|
||||||
|
|
||||||
## Default text editor
|
## Default text editor
|
||||||
## 'em' is a custom wrapper for emacsclient. See '.scripts/em'.
|
## 'em' is a custom wrapper for emacsclient. See '.scripts/em'.
|
||||||
## VISUAL is given priority by some programs like Mutt. This way we can separate
|
## VISUAL is given priority by some programs like Mutt. This way we can separate
|
||||||
|
@ -197,7 +193,7 @@ VISUAL="$EDITOR"
|
||||||
export GIT_EDITOR
|
export GIT_EDITOR
|
||||||
export VISUAL
|
export VISUAL
|
||||||
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
## Hook. Should be sourced last
|
## Hook. Should be sourced last
|
||||||
[ -f ~/.profile_hook ] && . ~/.profile_hook
|
[ -f ~/.profile_hook ] && . ~/.profile_hook
|
||||||
|
|
Loading…
Reference in New Issue