X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.profile.d%2Fvariables.bashrc;h=a4fda1eff163b516d09171a87285b8a41bba1410;hp=3182c19303326128d853d552f4012b51060b7284;hb=8a304871323fd8c0ab81b81a9082f07d03a1fa0c;hpb=864a356fcd49dd694cf18be8b4dfeb52c5a602d6 diff --git a/.profile.d/variables.bashrc b/.profile.d/variables.bashrc index 3182c19..a4fda1e 100644 --- a/.profile.d/variables.bashrc +++ b/.profile.d/variables.bashrc @@ -1,11 +1,7 @@ -# $Id$ export SSHTERM=urxvtc export SSHTERM_TITLE=-title export SSHTERM_EXEC=-e -#export TERM=xterm-xfree86 -export TERM=linux unset LANG -export LC_CTYPE=en_GB if ls --help 2>/dev/null | grep gnu.org >/dev/null; then export LS_OPTIONS="--color=auto -F -b --time-style=long-iso" elif [ "$SYSTEM" = "Darwin" ]; then @@ -18,5 +14,23 @@ export SSHTERM="urxvt" export SSHTERM_TITLE="-title" export SSHTERM_EXEC="-e" export GREP_COLOR='0;33' -export SCREENDIR="$HOME/.screen/$HOSTNAME" +# cx: Lines of context; sl: Matching lines; mt: Search string; fn: Filename +# ln: Line number; bn: Byte offset; se: Separators. +colours=$(tput colors) +if [ $colours = 256 ]; then + export GREP_COLORS='cx=38;5;246:sl=:mt=33:fn=38;5;25:ln=38;5;82:bn=33:se=38;5;246' +elif [ $colours -gt 88 ]; then + export GREP_COLORS='cx=38;5;84:sl=:mt=33:fn=38;5;22:ln=38;5;44:bn=33:se=38;5;84' +else + export GREP_COLORS='cx=31:sl=:mt=33:fn=36:ln=34:bn=33:se=31' +fi + +# Override SCREENDIR iff screen is not setuid. +screen=$(which screen &>/dev/null) +if [ ! -z "$screen" ]; then + if ! ls -l "$screen" | cut -d ' ' -f 1 | grep s >/dev/null; then + export SCREENDIR="$HOME/.screen/$HOSTNAME" + fi +fi +unset screen #mkdir -p "$SCREENDIR"