2 # $HOME/.profile (works with sh, ksh and bash)
5 # ~/.profile: executed by the command interpreter for login shells.
6 # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
8 # see /usr/share/doc/bash/examples/startup-files for examples.
9 # the files are located in the bash-doc package.
11 if test -n "$BASH_VERSION"; then
14 */*csh) SHELL=/bin/bash ;;
15 # this is for bash.exe
16 *command.com | *\\bash) SHELL=//c/ubin/bash ;;
18 #elif test -n "$KSH_VERSION"; then
20 #elif test -n "$FCEDIT"; then
22 #elif test -n "$ZSH_VERSION"; then
24 #elif test -n "$PS3"; then
30 if [ -z "$USER" ]; then
31 USER="$LOGNAME"; export USER
34 # the default umask is set in /etc/profile; for setting the umask
35 # for ssh logins, install and configure the libpam-umask package.
38 ### umask sets a mask for the default file permissions,
39 ### umask 022 is less restrictive, 077 more paranoid
42 PATH="$HOME"/bin:"$HOME"/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
43 MANPATH="$HOME"/man:/usr/local/man:/usr/share/man:/usr/man
44 # LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib
45 export PATH MANPATH # LD_LIBRARY_PATH
50 *UTF-8) # LC_CTYPE is already set
53 *) LC_CTYPE=ru_RU.KOI8-R
56 LC_COLLATE="$LC_CTYPE"
58 export LANG LC_CTYPE LC_COLLATE
65 ### uncomment to select an alternate timezone (/etc/localtime is default)
66 # TZ=/usr/share/zoneinfo/Europe/Moscow; export TZ
68 ### NEWS Configuration
71 export ORGANIZATION # NNTPSERVER
73 (set -P 2>/dev/null) && set -P # follow physical paths, not symlinks
75 # Interactive only commands
77 if [ -z "$TERM" ]; then
78 eval `tset -Q -s -m 'network:?xterm'`
83 if which less >/dev/null 2>&1; then
89 # mutt, python and vim
92 [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/dark_bg
95 *rxvt*|screen*|*term*|vt100)
98 [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg
102 if [ -x /usr/bin/dircolors ]; then
103 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
106 if [ -n "$HAS_LESS" ]; then
110 *UTF-8) LESSCHARSET=utf-8
113 *) LESSCHARSET=koi8-r
117 LESSEDIT='vim ?lt+%lt. -- %f'
118 export LESS LESSCHARSET LESSEDIT # LESSCHARDEF
120 # make less more friendly for non-text input files, see lesspipe(1)
121 #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
128 EDITOR="$HOME"/.vim/vim.sh
131 export EDITOR FCEDIT VISUAL
133 HISTCONTROL=ignoreboth
134 HISTIGNORE='&: *:x:X:[bf]g'
135 HISTFILE="$HOME/.sh_history"
138 export HISTCONTROL HISTIGNORE HISTFILE HISTFILESIZE HISTSIZE
140 # Used by bash/mc for hostname completion
141 HOSTFILE="$HOME"/lib/config/hosts
144 MAIL="/var/mail/$USER"
145 MAILPATH="$MAIL:$HOME/mail/admin:$HOME/mail/block:$HOME/mail/bulk"
146 if [ -d "$HOME"/mail/lists/ ]; then
147 MAILPATH="$MAILPATH:`echo $HOME/mail/lists/* | sed 's/ /:/g'`"
151 BROWSER="links2:links:elinks:w3m:lynx"
153 *rxvt*|screen*|*term*|vt100)
159 #all_proxy="http://localhost:3128"
160 #ftp_proxy="$all_proxy"
161 #gopher_proxy="$all_proxy"
162 #http_proxy="$all_proxy"
163 #https_proxy="$all_proxy"
164 auto_proxy="file:///home/phd/admin/WWW/Mozilla/mozilla.pac"
165 no_proxy="localhost,127.0.0.1"
166 #export all_proxy ftp_proxy http_proxy https_proxy auto_proxy no_proxy # gopher_proxy
167 export auto_proxy no_proxy
172 # set variable identifying the chroot you work in (used in the prompt below)
173 if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
174 debian_chroot="`cat /etc/debian_chroot`"
177 if test -n "$BASH_VERSION"; then
178 # display the user, host and current working directory
179 # in the terminal title
181 *rxvt*|screen*|*term*|vt100)
182 OPS1="\[\033]0;${debian_chroot:+($debian_chroot)}\u@\h:\w\007\]"
185 OPS1=${OPS1}"\[\033k${debian_chroot:+($debian_chroot)}\u@\h:\w\033\\\\\]" # Set screen/tmux caption
195 OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \W \\$"
199 OPS1="${debian_chroot:+($debian_chroot)}`/usr/bin/whoami`@`/bin/hostname -s` >"
204 ### biff controls new mail notification
206 ### mesg controls messages (write/talk) from other users
208 # make mail(1) use a pager
211 PYTHONSTARTUP="$HOME"/lib/python/init.py
215 email="phd@phdru.name"
217 GIT_AUTHOR_NAME="$name"
218 GIT_AUTHOR_EMAIL="$email"
219 GIT_COMMITTER_NAME="$name"
220 GIT_COMMITTER_EMAIL="$email"
221 export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL
223 HGUSER="$name <$email>"
228 #if test -f .hushlogin && ! cmp -s .motd /etc/motd; then
229 # tee $HOME/.motd < /etc/motd
233 # No need to set DISPLAY - ssh sets DISPLAY and calls xauth
234 #DISPLAY="`who am i | awk '{print substr($6, 2, length($6)-2 )}' | sed -e 's/:.*$//'`:0.0"
237 if [ -n "$DISPLAY" ]; then
238 # mutt, python and vim
241 [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg
244 BROWSER="firefox:seamonkey:chromium:google-chrome:opera:xlinks2:$BROWSER"
246 ### X Window System Configuration
247 #XAPPLRESDIR="$HOME/lib/X11/app-defaults/"; export XAPPLRESDIR
248 ### Old-style XNLSPATH
249 #XNLSPATH=/usr/X11R6/lib/X11/nls; export XNLSPATH
251 # For GTK2/GLib to convert filenames between internal and locale encodings
252 G_FILENAME_ENCODING="@locale"
253 export G_FILENAME_ENCODING
254 #G_BROKEN_FILENAMES=1
255 #export G_BROKEN_FILENAMES
257 # X Input Method, for Multi key (Compose) to work
260 export GTK_IM_MODULE QT_IM_MODULE
266 # nVidia OpenGL full scene anti-aliasing
268 #export __GL_FSAA_MODE
270 #xhost +local:root > /dev/null 2>&1
273 [ -n "$HAS_LESS" ] && unset HAS_LESS
276 # read in usepkg function
277 # . "$HOME"/lib/config/usepkg.sh
285 # If SUN console, start the windows system
287 # if [ `tty` = /dev/console ] ; then
288 # if [ "$TERM" = sun -o "$TERM" = AT386 ] ; then
290 # if [ ${OPENWINHOME:-""} = "" ] ; then
291 # OPENWINHOME=/usr/openwin
296 # echo "Starting OpenWindows in 5 seconds (type Control-C to interrupt)"
299 # "$OPENWINHOME"/bin/openwin
301 # clear # get rid of annoying cursor rectangle
302 # #exit # logout after leaving windows system
307 # If not running interactively, don't do anything
313 # Stop if non-interactive shell
314 [ -z "$PS1" ] && return
316 if [ -n "$SSH_CONNECTION" -a -z "$STY" -a -t 0 -a -x /usr/bin/screen ]
318 exec /usr/bin/screen -xRR -S default