.profile: loading one time only

master
Pierre Neidhardt 2013-07-25 21:12:09 +02:00
parent d3d829c89d
commit c4c1fe9fb2
3 changed files with 10 additions and 8 deletions

View File

@ -10,15 +10,13 @@
## Result for 027 is: rwxr-x---
umask 027
DUMMY=${DUMMY}:res
## Path
addpath()
{
[ $# -eq 2 ] && PATHVAR=$2 || PATHVAR=PATH
if [ -z "$(eval echo \$$PATHVAR)" ]; then
eval export $PATHVAR="$1"
elif [ -z "$(eval echo \$$PATHVAR | grep "\(:\|^\)$1\(:\|$\)")" ]; then
## Note that it is important for MANPATH to have an empty entry to keep
## searching in the default db path.
if [ -z "$(eval echo \$$PATHVAR | grep "\(:\|^\)$1\(:\|$\)")" ]; then
eval export $PATHVAR="\$$PATHVAR:$1"
fi
}

View File

@ -5,8 +5,9 @@
################################################################################
## This file is sourced by some DM and should not contain any desktop execution.
## Env vars and general config.
[ -f "$HOME/.profile" ] && . "$HOME/.profile"
## Env vars and general config. The .profile file should be automatically
## sourced by the login manager.
# [ -f "$HOME/.profile" ] && . "$HOME/.profile"
## X config (for URxvt, etc.)
[ -f "${HOME}/.Xresources" ] && xrdb -merge "${HOME}/.Xresources"

5
.zshrc
View File

@ -10,8 +10,11 @@
SHELL_CURRENT="$(ps -o command="" $$)"
SHELL_DIR="$HOME/.shell.d"
## .profile is sourced automatically when X is started, but we need to source it
## manually to TTY.
[ -z "$DISPLAY" ] && [ -f "$HOME/.profile" ] && . "$HOME/.profile"
## Should be sourced first.
[ -f "$HOME/.profile" ] && . "$HOME/.profile"
[ -f "${SHELL_DIR}/main_rc" ] && . "${SHELL_DIR}/main_rc"
[ -f "${SHELL_DIR}/options_zsh" ] && . "${SHELL_DIR}/options_zsh"