]> git.phdru.name Git - dotfiles.git/blob - .profile
.mc/mc.ext: Refactor opening/viewing zip files
[dotfiles.git] / .profile
1 #
2 # $HOME/.profile (works with sh, ksh and bash)
3 #
4
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
7 # exists.
8 # see /usr/share/doc/bash/examples/startup-files for examples.
9 # the files are located in the bash-doc package.
10
11 #if test -n "$BASH_VERSION"; then
12 #   bash
13 #elif test -n "$KSH_VERSION"; then
14 #   ksh93
15 #elif test -n "$FCEDIT"; then
16 #   ksh88
17 #elif test -n "$ZSH_VERSION"; then
18 #   zsh
19 #elif test -n "$PS3"; then
20 #   unknown
21 #else
22 #   sh
23 #fi
24
25 if [ -z "$USER" ]; then
26    USER="$LOGNAME"; export USER
27 fi
28
29 # the default umask is set in /etc/profile; for setting the umask
30 # for ssh logins, install and configure the libpam-umask package.
31 #umask 022
32
33 ### umask sets a mask for the default file permissions,
34 ### umask 022 is less restrictive, 077 more paranoid
35 umask 077
36
37 PATH="$HOME"/bin:"$HOME"/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
38 MANPATH="$HOME"/man:/usr/local/man:/usr/share/man:/usr/man
39 # LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib
40 export PATH MANPATH # LD_LIBRARY_PATH
41
42 LANG=C
43 #LC_ALL=C
44 case "$LC_CTYPE" in
45    *UTF-8) # LC_CTYPE is already set
46    ;;
47
48    *) LC_CTYPE=ru_RU.KOI8-R
49    ;;
50 esac
51 LC_COLLATE="$LC_CTYPE"
52 #LANGUAGE="ru en"
53 export LANG LC_CTYPE LC_COLLATE
54 unset LC_ALL LANGUAGE
55
56 # Default for df/du
57 BLOCKSIZE=1k
58 export BLOCKSIZE
59
60 ### uncomment to select an alternate timezone (/etc/localtime is default)
61 # TZ=/usr/share/zoneinfo/Europe/Moscow; export TZ
62
63 ### NEWS Configuration
64 ORGANIZATION=Home
65 # NNTPSERVER=news
66 export ORGANIZATION # NNTPSERVER
67
68 (set -P 2>/dev/null) && set -P # follow physical paths, not symlinks
69
70 # Interactive only commands
71 if [ -t 0 ] ; then
72    if [ -z "$TERM" ]; then
73       eval `tset -Q -s -m 'network:?xterm'`
74    fi
75
76    stty sane erase ^H
77
78    if which less >/dev/null 2>&1; then
79       HAS_LESS=true
80    fi
81
82    case "$TERM" in
83       linux)
84          # mutt, python and vim
85          BACKGROUND=DARK
86          export BACKGROUND
87          [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/dark_bg
88       ;;
89
90       *rxvt*|screen*|*term*|vt100)
91          BACKGROUND=LIGHT
92          export BACKGROUND
93          [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg
94       ;;
95    esac
96
97    if [ -x /usr/bin/dircolors ]; then
98        test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
99    fi
100
101    if [ -n "$HAS_LESS" ]; then
102       PAGER=less
103       LESS="Rgimq"
104       case "$LC_CTYPE" in
105          *UTF-8) LESSCHARSET=utf-8
106          ;;
107
108          *) LESSCHARSET=koi8-r
109          ;;
110       esac
111       #LESSCHARDEF=32c.
112       LESSEDIT='vim ?lt+%lt. -- %f'
113       export LESS LESSCHARSET LESSEDIT # LESSCHARDEF
114
115       # make less more friendly for non-text input files, see lesspipe(1)
116       #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
117
118    else
119       PAGER=more
120    fi
121    export PAGER
122
123    EDITOR="$HOME"/.vim/vim.sh
124    FCEDIT="$EDITOR"
125    VISUAL="$EDITOR"
126    export EDITOR FCEDIT VISUAL
127
128    HISTCONTROL=ignoreboth
129    HISTIGNORE='&: *:x:X:[bf]g'
130    HISTFILE="$HOME/.sh_history"
131    HISTFILESIZE=2000
132    HISTSIZE=1000
133    export HISTCONTROL HISTIGNORE HISTFILE HISTFILESIZE HISTSIZE
134
135    # Used by bash/mc for hostname completion
136    HOSTFILE="$HOME"/lib/config/hosts
137    export HOSTFILE
138
139    MAIL="/var/mail/$USER"
140    MAILPATH="$MAIL:$HOME/mail/admin:$HOME/mail/block:$HOME/mail/bulk"
141    if [ -d "$HOME"/mail/lists/ ]; then
142          MAILPATH="$MAILPATH:`echo $HOME/mail/lists/* | sed 's/ /:/g'`"
143    fi
144    export MAIL MAILPATH
145
146    BROWSER="links2:links:elinks:w3m:lynx"
147    case "$TERM" in
148       *rxvt*|screen*|*term*|vt100)
149          BROWSER="l:$BROWSER"
150       ;;
151    esac
152    export BROWSER
153
154    #all_proxy="http://localhost:3128"
155    #ftp_proxy="$all_proxy"
156    #gopher_proxy="$all_proxy"
157    #http_proxy="$all_proxy"
158    #https_proxy="$all_proxy"
159    auto_proxy="file:///home/phd/admin/WWW/Mozilla/mozilla.pac"
160    no_proxy="localhost,127.0.0.1"
161    #export all_proxy ftp_proxy http_proxy https_proxy auto_proxy no_proxy # gopher_proxy
162    export auto_proxy no_proxy
163
164    ENV="$HOME/.shellrc"
165    export ENV
166
167    # set variable identifying the chroot you work in (used in the prompt below)
168    if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
169        debian_chroot="`cat /etc/debian_chroot`"
170    fi
171
172    if test -n "$BASH_VERSION"; then
173       . "$HOME/.bashrc"
174    else
175       PS1="${debian_chroot:+($debian_chroot)}`/usr/bin/whoami`@`/bin/hostname -s` > "
176    fi
177
178    ### biff controls new mail notification
179    #biff n
180    ### mesg controls messages (write/talk) from other users
181    mesg n
182    # make mail(1) use a pager
183    crt=; export crt
184
185    PYTHONSTARTUP="$HOME"/lib/python/init.py
186    export PYTHONSTARTUP
187
188    name="Oleg Broytman"
189    email="phd@phdru.name"
190
191    GIT_AUTHOR_NAME="$name"
192    GIT_AUTHOR_EMAIL="$email"
193    GIT_COMMITTER_NAME="$name"
194    GIT_COMMITTER_EMAIL="$email"
195    export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL
196
197    HGUSER="$name <$email>"
198    export HGUSER
199
200    unset name email
201
202    #if test -f .hushlogin && ! cmp -s .motd /etc/motd; then
203    #   tee $HOME/.motd < /etc/motd
204    #fi
205
206    #if which pyenv >/dev/null 2>&1; then
207    #   PYENV_ROOT="$HOME/.pyenv"
208    #   export PYENV_ROOT
209    #   PATH="$PYENV_ROOT/bin:$PATH"
210    #   eval "`pyenv init --path`"
211    #fi
212
213 fi
214
215 # No need to set DISPLAY - ssh sets DISPLAY and calls xauth
216 #DISPLAY="`who am i | awk '{print substr($6, 2, length($6)-2 )}' | sed -e 's/:.*$//'`:0.0"
217 #export DISPLAY
218
219 if [ -n "$DISPLAY" ]; then
220    # mutt, python and vim
221    BACKGROUND=LIGHT
222    export BACKGROUND
223    [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg
224
225    # BROWSERs
226    BROWSER="firefox:seamonkey:chromium:google-chrome:opera:xlinks2:$BROWSER"
227
228    ### X Window System Configuration
229    #XAPPLRESDIR="$HOME/lib/X11/app-defaults/"; export XAPPLRESDIR
230    ### Old-style XNLSPATH
231    #XNLSPATH=/usr/X11R6/lib/X11/nls; export XNLSPATH
232
233    # For GTK2/GLib to convert filenames between internal and locale encodings
234    G_FILENAME_ENCODING="@locale"
235    export G_FILENAME_ENCODING
236    #G_BROKEN_FILENAMES=1
237    #export G_BROKEN_FILENAMES
238
239    # X Input Method, for Multi key (Compose) to work
240    GTK_IM_MODULE=xim
241    QT_IM_MODULE=xim
242    export GTK_IM_MODULE QT_IM_MODULE
243
244    # GTK2 anti-aliasing
245    GDK_USE_XFT=1
246    export GDK_USE_XFT
247
248    # nVidia OpenGL full scene anti-aliasing
249    #__GL_FSAA_MODE=4
250    #export __GL_FSAA_MODE
251
252    #xhost +local:root > /dev/null 2>&1
253 fi
254
255 [ -n "$HAS_LESS" ] && unset HAS_LESS
256
257 #
258 # read in usepkg function
259 # . "$HOME"/lib/config/usepkg.sh
260 #
261
262 #
263 # usepkg gnu
264 #
265
266 #
267 # If SUN console, start the windows system
268 #
269 # if [ `tty` = /dev/console ] ; then
270 #    if [ "$TERM" = sun -o "$TERM" = AT386 ] ; then
271 #
272 #       if [ ${OPENWINHOME:-""} = "" ] ; then
273 #          OPENWINHOME=/usr/openwin
274 #          export OPENWINHOME
275 #       fi
276 #
277 #       echo ""
278 #       echo "Starting OpenWindows in 5 seconds (type Control-C to interrupt)"
279 #       sleep 5
280 #
281 #       "$OPENWINHOME"/bin/openwin
282 #
283 #       clear      # get rid of annoying cursor rectangle
284 #       #exit      # logout after leaving windows system
285 #
286 #    fi
287 # fi