]> git.phdru.name Git - dotfiles.git/blob - .profile
.mc/menu: Verify detached signature
[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 test -f .hushlogin && ! cmp -s .motd /etc/motd; then
73     #   tee $HOME/.motd < /etc/motd
74     #fi
75
76     if [ -z "$TERM" ]; then
77         eval `tset -Q -s -m 'network:?xterm'`
78     fi
79
80     stty sane erase ^H
81
82     if which less >/dev/null 2>&1; then
83         HAS_LESS=true
84     fi
85
86     case "$TERM" in
87         linux)
88             # mutt, python and vim
89             BACKGROUND=DARK
90             export BACKGROUND
91             [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/dark_bg
92         ;;
93
94         *rxvt*|screen*|*term*|vt100)
95             BACKGROUND=LIGHT
96             export BACKGROUND
97             [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg
98         ;;
99     esac
100
101     if [ -x /usr/bin/dircolors ]; then
102         test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
103     fi
104
105     if [ -n "$HAS_LESS" ]; then
106         PAGER=less
107         LESS="Rgimq"
108         case "$LC_CTYPE" in
109             *UTF-8) LESSCHARSET=utf-8
110             ;;
111
112             *) LESSCHARSET=koi8-r
113             ;;
114         esac
115         #LESSCHARDEF=32c.
116         LESSEDIT='vim ?lt+%lt. -- %f'
117         export LESS LESSCHARSET LESSEDIT # LESSCHARDEF
118
119         # make less more friendly for non-text input files, see lesspipe(1)
120         #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
121
122     else
123         PAGER=more
124     fi
125     export PAGER
126
127     EDITOR="$HOME"/.vim/vim.sh
128     FCEDIT="$EDITOR"
129     VISUAL="$EDITOR"
130     export EDITOR FCEDIT VISUAL
131
132     HISTCONTROL=ignoreboth
133     HISTIGNORE='&: *:x:X:[bf]g'
134     HISTFILE="$HOME/.sh_history"
135     HISTFILESIZE=2000
136     HISTSIZE=1000
137     export HISTCONTROL HISTIGNORE HISTFILE HISTFILESIZE HISTSIZE
138
139     # Used by bash/mc for hostname completion
140     HOSTFILE="$HOME"/lib/config/hosts
141     export HOSTFILE
142
143     MAIL="/var/mail/$USER"
144     MAILPATH="$MAIL:$HOME/mail/admin:$HOME/mail/block:$HOME/mail/bulk"
145     for mbox in "$HOME/mail/aviel" "$HOME/mail/stcnet"; do
146         if [ -f "$mbox" ]; then
147             MAILPATH="$mbox:$MAILPATH"
148         fi
149     done
150     if [ -d "$HOME"/mail/lists/ ]; then
151             MAILPATH="$MAILPATH:`echo $HOME/mail/lists/* | sed 's/ /:/g'`"
152     fi
153     export MAIL MAILPATH
154     if [ "x$SET_MAILCHECK" != xYES ]; then
155         unset MAILCHECK
156     else
157         unset SET_MAILCHECK
158     fi
159     unset mbox
160
161     BROWSER="links2:links:elinks:w3m:lynx"
162     case "$TERM" in
163         *rxvt*|screen*|*term*|vt100)
164             BROWSER="l:$BROWSER"
165         ;;
166     esac
167     export BROWSER
168
169     #all_proxy="http://localhost:3128"
170     #ftp_proxy="$all_proxy"
171     #gopher_proxy="$all_proxy"
172     #http_proxy="$all_proxy"
173     #https_proxy="$all_proxy"
174     auto_proxy="file:///home/phd/admin/WWW/Mozilla/mozilla.pac"
175     no_proxy="localhost,127.0.0.1,192.168.,10.,aviel.ru,progtech.ru"
176     #export all_proxy ftp_proxy http_proxy https_proxy auto_proxy no_proxy # gopher_proxy
177     export auto_proxy no_proxy
178
179     ENV="$HOME/.shellrc"
180     export ENV
181
182     # set variable identifying the chroot you work in (used in the prompt below)
183     if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
184         debian_chroot="`cat /etc/debian_chroot`"
185     fi
186
187     if test -n "$BASH_VERSION"; then
188         . "$HOME/.bashrc"
189     else
190         PS1="${debian_chroot:+($debian_chroot)}`/usr/bin/whoami`@`/bin/hostname -s` > "
191     fi
192
193     ### biff controls new mail notification
194     #biff n
195     ### mesg controls messages (write/talk) from other users
196     mesg n
197     # make mail(1) use a pager
198     crt=; export crt
199
200     PYTHONSTARTUP="$HOME"/lib/python/init.py
201     export PYTHONSTARTUP
202
203     name="Oleg Broytman"
204     email="phd@phdru.name"
205
206     GIT_AUTHOR_NAME="$name"
207     GIT_AUTHOR_EMAIL="$email"
208     GIT_COMMITTER_NAME="$name"
209     GIT_COMMITTER_EMAIL="$email"
210     export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL
211
212     HGUSER="$name <$email>"
213     export HGUSER
214
215     unset name email
216
217     #if which pyenv >/dev/null 2>&1; then
218     #   PYENV_ROOT="$HOME/.pyenv"
219     #   export PYENV_ROOT
220     #   PATH="$PYENV_ROOT/bin:$PATH"
221     #   eval "`pyenv init --path`"
222     #fi
223
224     #SCREENDIR="$HOME"/tmp/screen
225     #export SCREENDIR
226     #mkdir -p "$SCREENDIR"
227     #chmod 700 "$SCREENDIR"
228 fi
229
230 # No need to set DISPLAY - ssh sets DISPLAY and calls xauth
231 #DISPLAY="`who am i | awk '{print substr($6, 2, length($6)-2 )}' | sed -e 's/:.*$//'`:0.0"
232 #export DISPLAY
233
234 if [ -n "$DISPLAY" ]; then
235     # mutt, python and vim
236     BACKGROUND=LIGHT
237     export BACKGROUND
238     [ -n "$HAS_LESS" ] && . "$HOME"/lib/config/less/light_bg
239
240     # BROWSERs
241     BROWSER="firefox:seamonkey:chromium:google-chrome:opera:xlinks2:$BROWSER"
242
243     ### X Window System Configuration
244     #XAPPLRESDIR="$HOME/lib/X11/app-defaults/"; export XAPPLRESDIR
245     ### Old-style XNLSPATH
246     #XNLSPATH=/usr/X11R6/lib/X11/nls; export XNLSPATH
247
248     # For GTK2/GLib to convert filenames between internal and locale encodings
249     G_FILENAME_ENCODING="@locale"
250     export G_FILENAME_ENCODING
251     #G_BROKEN_FILENAMES=1
252     #export G_BROKEN_FILENAMES
253
254     # X Input Method, for Multi key (Compose) to work
255     GTK_IM_MODULE=xim
256     QT_IM_MODULE=xim
257     export GTK_IM_MODULE QT_IM_MODULE
258
259     # GTK2 anti-aliasing
260     GDK_USE_XFT=1
261     export GDK_USE_XFT
262
263     # nVidia OpenGL full scene anti-aliasing
264     #__GL_FSAA_MODE=4
265     #export __GL_FSAA_MODE
266
267     #xhost +local:root > /dev/null 2>&1
268 fi
269
270 [ -n "$HAS_LESS" ] && unset HAS_LESS
271
272 #
273 # read in usepkg function
274 # . "$HOME"/lib/config/usepkg.sh
275 #
276
277 #
278 # usepkg gnu
279 #
280
281 #
282 # If SUN console, start the windows system
283 #
284 # if [ `tty` = /dev/console ] ; then
285 #   if [ "$TERM" = sun -o "$TERM" = AT386 ] ; then
286 #
287 #       if [ ${OPENWINHOME:-""} = "" ] ; then
288 #           OPENWINHOME=/usr/openwin
289 #           export OPENWINHOME
290 #       fi
291 #
292 #       echo ""
293 #       echo "Starting OpenWindows in 5 seconds (type Control-C to interrupt)"
294 #       sleep 5
295 #
296 #       "$OPENWINHOME"/bin/openwin
297 #
298 #       clear       # get rid of annoying cursor rectangle
299 #       #exit       # logout after leaving windows system
300 #
301 #   fi
302 # fi