]> code.delx.au - dotfiles/blob - .bash/environment
screen prompt change
[dotfiles] / .bash / environment
1 #! bash
2
3 # This file sets up the environment correctly. It gets run for every shell,
4 # so it must be fast. Also, starting a shell within a shell shouldn't change
5 # the environment. The path manipulation functions are useful for this.
6
7 # Root gets the default umask. Files created by my user are only rwx by user/group
8 if [ "$(id -un)" = "root" ]; then
9 umask 0022
10 else
11 umask 0007
12 fi
13
14 # General environment settings
15 export PAGER="less"
16 export LESS="RS"
17 export PYTHONSTARTUP="${HOME}/.pythonrc.py"
18 export EMAIL="James Bunton <jamesbunton@delx.net.au>"
19
20 # Editor settings
21 if emacsclient --version &> /dev/null; then
22 export ALTERNATE_EDITOR="vim"
23 export EDITOR="emacsclient --tty"
24
25 if [[ "$TERM" == screen* ]]; then
26 export EDITORBG="$EDITOR"
27 else
28 export EDITORBG="emacsclient --create-frame --no-wait"
29 fi
30 else
31 export EDITOR="vim"
32 export EDITORBG="vim"
33 fi
34
35 source "${HOME}/.bash/functions"
36
37 pathprepend "${HOME}/bin"
38
39 # Pick up SSH agent socket in case it isn't set automatically
40 if [ -z "$SSH_AUTH_SOCK" ]; then
41 export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
42 fi
43
44 # Load local environment settings
45 [ -r "${HOME}/.bash/environment_local" ] && source "${HOME}/.bash/environment_local"
46