Don't override SCREENDIR when screen is setuid.
[profile.git] / .profile.d / variables.bashrc
1 # $Id$
2 export SSHTERM=urxvtc
3 export SSHTERM_TITLE=-title
4 export SSHTERM_EXEC=-e
5 unset LANG
6 if ls --help 2>/dev/null | grep gnu.org >/dev/null; then
7   export LS_OPTIONS="--color=auto -F -b --time-style=long-iso"
8 elif [ "$SYSTEM" = "Darwin" ]; then
9   export LS_OPTIONS="-G -F -b"
10 fi
11 export VISUAL=vim
12 eval `dircolors 2>/dev/null` 2>/dev/null
13 unset XMODIFIERS #:-(
14 export SSHTERM="urxvt"
15 export SSHTERM_TITLE="-title"
16 export SSHTERM_EXEC="-e"
17 export GREP_COLOR='0;33'
18 # cx: Lines of context; sl: Matching lines; mt: Search string; fn: Filename
19 # ln: Line number; bn: Byte offset; se: Separators.
20 colours=$(tput colors)
21 if [ $colours = 256 ]; then
22   export GREP_COLORS='cx=38;5;246:sl=:mt=33:fn=38;5;25:ln=38;5;82:bn=33:se=38;5;246'
23 elif [ $colours -gt 88 ]; then
24   export GREP_COLORS='cx=38;5;84:sl=:mt=33:fn=38;5;22:ln=38;5;44:bn=33:se=38;5;84'
25 else
26   export GREP_COLORS='cx=31:sl=:mt=33:fn=36:ln=34:bn=33:se=31'
27 fi
28
29 # Override SCREENDIR iff screen is not setuid.
30 screen=$(which screen 2>/dev/null)
31 if [ ! -z "$screen" ]; then
32   if ! ls -l "$screen" | cut -d ' ' -f 1 | grep s >/dev/null; then
33     export SCREENDIR="$HOME/.screen/$HOSTNAME"
34   fi
35 fi
36 unset screen
37 #mkdir -p "$SCREENDIR"