X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.profile;h=5934957dc63e48c703113162636e2e64517fa8a4;hp=2fd98f0219105c778ceaf0cbe52be446fd3fe5fd;hb=2b62dc3c99982d930d17479a34af984f196f5c5d;hpb=f31430bb4189af8383ddbd4456ee0684c4174d75 diff --git a/.profile b/.profile index 2fd98f0..5934957 100644 --- a/.profile +++ b/.profile @@ -60,33 +60,47 @@ if [ -t 0 ] ; then stty sane erase ^H + if [ -n "`which less 2>/dev/null`" ]; then + HAS_LESS=true + fi + case "$TERM" in linux) # mutt, python and vim BACKGROUND=DARK export BACKGROUND - . "$HOME"/lib/config/less/dark_bg + [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/dark_bg ;; *rxvt*|screen*|*term*|vt100) BACKGROUND=LIGHT export BACKGROUND - . "$HOME"/lib/config/less/light_bg + [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg ;; esac - PAGER=less - LESS="-gimq" - case "$LC_CTYPE" in - *UTF-8) LESSCHARSET=utf-8 - ;; + if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + fi - *) LESSCHARSET=koi8-r - ;; - esac - #LESSCHARDEF=32c. - LESSEDIT='vim ?lm+%lm -- %f' - export PAGER LESS LESSCHARSET LESSEDIT # LESSCHARDEF + if [ -n "$HAS_LESS" ]; then + PAGER=less + LESS="FRXgimq" + case "$LC_CTYPE" in + *UTF-8) LESSCHARSET=utf-8 + ;; + + *) LESSCHARSET=koi8-r + ;; + esac + #LESSCHARDEF=32c. + LESSEDIT='vim ?lt+%lt. -- %f' + export LESS LESSCHARSET LESSEDIT # LESSCHARDEF + + else + PAGER=more + fi + export PAGER EDITOR="$HOME"/.vim/vim.sh VISUAL="$EDITOR" @@ -135,7 +149,24 @@ if [ -t 0 ] ; then case "$SHELL" in */bash) shopt -s checkwinsize - OPS1='\u@\h ' + # display the user, host and current working directory + # in the terminal title + case "$TERM" in + *rxvt*|screen*|*term*|vt100) + OPS1="\[\033]0;\u@\h:\w\007\]" + case "$TERM" in + screen*) + OPS1=${OPS1}"\[\033k\u@\h:\w\033\\\\\]" # Set screen/tmux caption + ;; + esac + ;; + + *) + OPS1="" + ;; + esac + + OPS1=${OPS1}"\u@\h \W " . "$ENV" ;; *) @@ -143,16 +174,8 @@ if [ -t 0 ] ; then ;; esac - export OPS1 - - case "$TERM" in - *rxvt*|screen*|*term*|vt100) - if [ -x "`which xtitle 2>/dev/null`" ]; then - PROMPT_COMMAND=xtitle - export PROMPT_COMMAND - fi - ;; - esac + #PROMPT_DIRTRIM=2 + export OPS1 # PROMPT_DIRTRIM ### biff controls new mail notification #biff n @@ -177,6 +200,10 @@ if [ -t 0 ] ; then export HGUSER unset name email + + if test -f .hushlogin && ! cmp -s .motd /etc/motd; then + tee $HOME/.motd < /etc/motd + fi fi # No need to set DISPLAY - ssh sets DISPLAY and calls xauth @@ -187,7 +214,7 @@ if [ -n "$DISPLAY" ]; then # mutt, python and vim BACKGROUND=LIGHT export BACKGROUND - . "$HOME"/lib/config/less/light_bg + [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg # BROWSERs BROWSER="firefox:seamonkey:chromium:google-chrome:opera:xlinks2:$BROWSER" @@ -217,6 +244,8 @@ if [ -n "$DISPLAY" ]; then #export __GL_FSAA_MODE fi +[ -n "$HAS_LESS" ] && unset HAS_LESS + # # read in usepkg function # . "$HOME"/lib/config/usepkg.sh