X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.profile;h=f222e80f965b338391c866a1698fbd9d1002fd65;hp=5eab941ba26d926872315dae0c00efcc05c9c8f7;hb=HEAD;hpb=06aade9277f622770a1f3041012e6d90bf62519f diff --git a/.profile b/.profile index 5eab941..45b4a56 100644 --- a/.profile +++ b/.profile @@ -2,24 +2,39 @@ # $HOME/.profile (works with sh, ksh and bash) # -case "$SHELL" in - */*csh) SHELL=/bin/bash - ;; - # this is for bash.exe - *command.com | \ - *\\bash) SHELL=//c/ubin/bash - ;; -esac +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +#if test -n "$BASH_VERSION"; then +# bash +#elif test -n "$KSH_VERSION"; then +# ksh93 +#elif test -n "$FCEDIT"; then +# ksh88 +#elif test -n "$ZSH_VERSION"; then +# zsh +#elif test -n "$PS3"; then +# unknown +#else +# sh +#fi if [ -z "$USER" ]; then - USER="$LOGNAME"; export USER + USER="$LOGNAME"; export USER fi +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + ### umask sets a mask for the default file permissions, ### umask 022 is less restrictive, 077 more paranoid umask 077 -PATH="$HOME"/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +PATH="$HOME"/bin:"$HOME"/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MANPATH="$HOME"/man:/usr/local/man:/usr/share/man:/usr/man # LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib export PATH MANPATH # LD_LIBRARY_PATH @@ -27,11 +42,11 @@ export PATH MANPATH # LD_LIBRARY_PATH LANG=C #LC_ALL=C case "$LC_CTYPE" in - *UTF-8) # LC_CTYPE is already set - ;; + *UTF-8) # LC_CTYPE is already set + ;; - *) LC_CTYPE=ru_RU.KOI8-R - ;; + *) LC_CTYPE=ru_RU.KOI8-R + ;; esac LC_COLLATE="$LC_CTYPE" #LANGUAGE="ru en" @@ -54,137 +69,147 @@ export ORGANIZATION # NNTPSERVER # Interactive only commands if [ -t 0 ] ; then - if [ -z "$TERM" ]; then - eval `tset -Q -s -m 'network:?xterm'` - fi - - stty sane erase ^H - - case "$TERM" in - linux) - # mutt, python and vim - BACKGROUND=DARK - export BACKGROUND - . "$HOME"/lib/config/less/dark_bg - ;; - - *rxvt*|screen*|*term*|vt100) - BACKGROUND=LIGHT - export BACKGROUND - . "$HOME"/lib/config/less/light_bg - ;; - esac - - if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - fi - - 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 PAGER LESS LESSCHARSET LESSEDIT # LESSCHARDEF - - EDITOR="$HOME"/.vim/vim.sh - VISUAL="$EDITOR" - FCEDIT="$EDITOR" - export EDITOR VISUAL FCEDIT - - HISTCONTROL=ignoreboth - HISTIGNORE='&: *:x:X:[bf]g' - HISTFILE="$HOME/.sh_history" - HISTFILESIZE=1000 - HISTSIZE=1000 - export HISTCONTROL HISTIGNORE HISTFILE HISTFILESIZE HISTSIZE - - # Used by bash/mc for hostname completion - HOSTFILE="$HOME"/lib/config/hosts - export HOSTFILE - - MAIL="/var/mail/$USER" - MAILPATH="$MAIL:$HOME/mail/admin:$HOME/mail/block:$HOME/mail/bulk" - if [ -d "$HOME"/mail/lists/ ]; then - MAILPATH="$MAILPATH:`echo $HOME/mail/lists/* | sed 's/ /:/g'`" - fi - export MAIL MAILPATH - - BROWSER="links2:links:elinks:w3m:lynx" - case "$TERM" in - *rxvt*|screen*|*term*|vt100) - BROWSER="l:$BROWSER" - ;; - esac - export BROWSER - - #all_proxy="http://localhost:3128" - #ftp_proxy="$all_proxy" - #gopher_proxy="$all_proxy" - #http_proxy="$all_proxy" - #https_proxy="$all_proxy" - auto_proxy="file:///home/phd/admin/WWW/Mozilla/mozilla.pac" - no_proxy="localhost,127.0.0.1" - #export all_proxy ftp_proxy http_proxy https_proxy auto_proxy no_proxy # gopher_proxy - export auto_proxy no_proxy - - ENV="$HOME/.shellrc" - export ENV - - case "$SHELL" in - */bash) - shopt -s checkwinsize - OPS1='\u@\h ' - . "$ENV" - ;; - *) - OPS1="`/usr/bin/whoami`@`/bin/hostname -s` " - ;; - 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 - - ### biff controls new mail notification - #biff n - ### mesg controls messages (write/talk) from other users - mesg n - # make mail(1) use a pager - crt=; export crt - - PYTHONSTARTUP="$HOME"/lib/python/init.py - export PYTHONSTARTUP - - name="Oleg Broytman" - email="phd@phdru.name" - - GIT_AUTHOR_NAME="$name" - GIT_AUTHOR_EMAIL="$email" - GIT_COMMITTER_NAME="$name" - GIT_COMMITTER_EMAIL="$email" - export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL - - HGUSER="$name <$email>" - export HGUSER - - unset name email - - if test -f .hushlogin && ! cmp -s .motd /etc/motd; then - tee $HOME/.motd < /etc/motd - fi + #if test -f .hushlogin && ! cmp -s .motd /etc/motd; then + # tee $HOME/.motd < /etc/motd + #fi + + if [ -z "$TERM" ]; then + eval `tset -Q -s -m 'network:?xterm'` + fi + + stty sane erase ^H + + if which less >/dev/null 2>&1; then + HAS_LESS=true + fi + + case "$TERM" in + linux) + # mutt, python and vim + BACKGROUND=DARK + export BACKGROUND + [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/dark_bg + ;; + + *rxvt*|screen*|*term*|vt100) + BACKGROUND=LIGHT + export BACKGROUND + [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg + ;; + esac + + if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + fi + + if [ -n "$HAS_LESS" ]; then + PAGER=less + LESS="Rgimq" + 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 + + # make less more friendly for non-text input files, see lesspipe(1) + #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + + else + PAGER=more + fi + export PAGER + + EDITOR="$HOME"/.vim/vim.sh + FCEDIT="$EDITOR" + VISUAL="$EDITOR" + export EDITOR FCEDIT VISUAL + + HISTCONTROL=ignoreboth + HISTIGNORE="`echo '&: *:~\?*:[bf]g:cd:clear:e:exit:logout:l:ls:ll:llp:[m,]c:ØÓ:w:X:x' | iconv -f koi8-r`" + HISTFILE="$HOME/.sh_history" + HISTFILESIZE=2000 + HISTSIZE=1000 + export HISTCONTROL HISTIGNORE HISTFILE HISTFILESIZE HISTSIZE + + # Used by bash/mc for hostname completion + HOSTFILE="$HOME"/lib/config/hosts + export HOSTFILE + + MAIL="/var/mail/$USER" + MAILPATH="$MAIL:$HOME/mail/admin:$HOME/mail/block:$HOME/mail/bulk" + if [ -d "$HOME"/mail/lists/ ]; then + MAILPATH="$MAILPATH:`echo $HOME/mail/lists/* | sed 's/ /:/g'`" + fi + export MAIL MAILPATH + if [ -n "$STY" -a "$WINDOW" != 0 ]; then + unset MAILCHECK + fi + + BROWSER="links2:links:elinks:w3m:lynx" + case "$TERM" in + *rxvt*|screen*|*term*|vt100) + BROWSER="l:$BROWSER" + ;; + esac + export BROWSER + + #all_proxy="http://localhost:3128" + #ftp_proxy="$all_proxy" + #gopher_proxy="$all_proxy" + #http_proxy="$all_proxy" + #https_proxy="$all_proxy" + auto_proxy="file:///home/phd/admin/WWW/Mozilla/mozilla.pac" + no_proxy="localhost,127.0.0.1" + #export all_proxy ftp_proxy http_proxy https_proxy auto_proxy no_proxy # gopher_proxy + export auto_proxy no_proxy + + ENV="$HOME/.shellrc" + export ENV + + # set variable identifying the chroot you work in (used in the prompt below) + if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot="`cat /etc/debian_chroot`" + fi + + if test -n "$BASH_VERSION"; then + . "$HOME/.bashrc" + else + PS1="${debian_chroot:+($debian_chroot)}`/usr/bin/whoami`@`/bin/hostname -s` > " + fi + + ### biff controls new mail notification + #biff n + ### mesg controls messages (write/talk) from other users + mesg n + # make mail(1) use a pager + crt=; export crt + + PYTHONSTARTUP="$HOME"/lib/python/init.py + export PYTHONSTARTUP + + name="Oleg Broytman" + email="phd@phdru.name" + + GIT_AUTHOR_NAME="$name" + GIT_AUTHOR_EMAIL="$email" + GIT_COMMITTER_NAME="$name" + GIT_COMMITTER_EMAIL="$email" + export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL + + HGUSER="$name <$email>" + export HGUSER + + unset name email + + #SCREENDIR="$HOME"/tmp/screen + #export SCREENDIR + #mkdir -p "$SCREENDIR" + #chmod 700 "$SCREENDIR" fi # No need to set DISPLAY - ssh sets DISPLAY and calls xauth @@ -192,39 +217,45 @@ fi #export DISPLAY if [ -n "$DISPLAY" ]; then - # mutt, python and vim - BACKGROUND=LIGHT - export BACKGROUND - . "$HOME"/lib/config/less/light_bg - - # BROWSERs - BROWSER="firefox:seamonkey:chromium:google-chrome:opera:xlinks2:$BROWSER" - - ### X Window System Configuration - #XAPPLRESDIR="$HOME/lib/X11/app-defaults/"; export XAPPLRESDIR - ### Old-style XNLSPATH - #XNLSPATH=/usr/X11R6/lib/X11/nls; export XNLSPATH - - # For GTK2/GLib to convert filenames between internal and locale encodings - G_FILENAME_ENCODING="@locale" - export G_FILENAME_ENCODING - #G_BROKEN_FILENAMES=1 - #export G_BROKEN_FILENAMES - - # X Input Method, for Multi key (Compose) to work - GTK_IM_MODULE=xim - QT_IM_MODULE=xim - export GTK_IM_MODULE QT_IM_MODULE - - # GTK2 anti-aliasing - GDK_USE_XFT=1 - export GDK_USE_XFT - - # nVidia OpenGL full scene anti-aliasing - #__GL_FSAA_MODE=4 - #export __GL_FSAA_MODE + PATH=$PATH:/usr/games + + # mutt, python and vim + BACKGROUND=LIGHT + export BACKGROUND + [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg + + # BROWSERs + BROWSER="firefox:seamonkey:chromium:google-chrome:opera:xlinks2:$BROWSER" + + ### X Window System Configuration + #XAPPLRESDIR="$HOME/lib/X11/app-defaults/"; export XAPPLRESDIR + ### Old-style XNLSPATH + #XNLSPATH=/usr/X11R6/lib/X11/nls; export XNLSPATH + + # For GTK2/GLib to convert filenames between internal and locale encodings + G_FILENAME_ENCODING="@locale" + export G_FILENAME_ENCODING + #G_BROKEN_FILENAMES=1 + #export G_BROKEN_FILENAMES + + # X Input Method, for Multi key (Compose) to work + GTK_IM_MODULE=xim + QT_IM_MODULE=xim + export GTK_IM_MODULE QT_IM_MODULE + + # GTK2 anti-aliasing + GDK_USE_XFT=1 + export GDK_USE_XFT + + # nVidia OpenGL full scene anti-aliasing + #__GL_FSAA_MODE=4 + #export __GL_FSAA_MODE + + #xhost +local:root > /dev/null 2>&1 fi +[ -n "$HAS_LESS" ] && unset HAS_LESS + # # read in usepkg function # . "$HOME"/lib/config/usepkg.sh @@ -238,11 +269,11 @@ fi # If SUN console, start the windows system # # if [ `tty` = /dev/console ] ; then -# if [ "$TERM" = sun -o "$TERM" = AT386 ] ; then +# if [ "$TERM" = sun -o "$TERM" = AT386 ] ; then # # if [ ${OPENWINHOME:-""} = "" ] ; then -# OPENWINHOME=/usr/openwin -# export OPENWINHOME +# OPENWINHOME=/usr/openwin +# export OPENWINHOME # fi # # echo "" @@ -251,8 +282,8 @@ fi # # "$OPENWINHOME"/bin/openwin # -# clear # get rid of annoying cursor rectangle -# #exit # logout after leaving windows system +# clear # get rid of annoying cursor rectangle +# #exit # logout after leaving windows system # -# fi +# fi # fi