-
Notifications
You must be signed in to change notification settings - Fork 4
/
.profile
154 lines (123 loc) · 3.17 KB
/
.profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# ~/.profile: executed by the command interpreter for login shells.
#
# https://github.com/agkozak/dotfiles
#
# shellcheck shell=sh
# shellcheck disable=SC1090,SC1091,SC2034
# For SUSE {{{1
if [ -d /etc/YaST2 ] && [ -z "$PROFILEREAD" ] && [ -f /etc/profile ]; then
. /etc/profile
fi
# }}}1
# AGKDOT_SYSTEMINFO {{{1
export AGKDOT_SYSTEMINFO
: "${AGKDOT_SYSTEMINFO:=$(uname -a)}"
# }}}1
# Environment variables {{{1
export BAT_THEME
BAT_THEME=zenburn
export EDITOR VISUAL
if command -v vim > /dev/null 2>&1; then
EDITOR='vim'
else
EDITOR='vi'
fi
VISUAL="$EDITOR"
export ENV
ENV="${HOME}/.shrc"
export GEM_HOME
GEM_HOME="${HOME}/gems"
export LESS
case $AGKDOT_SYSTEMINFO in
UWIN*) LESS=-i ;;
*) LESS=-FiRX ;;
esac
# Always use Unicode line-drawing characters, not VT100-style ones
export NCURSES_NO_UTF8_ACS
NCURSES_NO_UTF8_ACS=1
export PAGER
PAGER='less'
# More modern utilities on Solaris
# case $systeminfo in
# SunOS*) PATH="$(getconf PATH):$PATH" ;;
# esac
export PATH
_agkdot_construct_path() {
while [ $# -gt 0 ]; do
if [ -d "$1" ]; then
case $PATH in
$1:*|*:$1:*|*:$1) ;;
*) PATH="$1:${PATH}" ;;
esac
fi
shift
done
}
_agkdot_construct_path '/mingw64/bin' \
"${HOME}/.local/bin" \
"${HOME}/.cabal/bin" \
"${HOME}/.config/composer/vendor/bin" \
"${HOME}/.composer/vendor/bin" \
"${HOME}/gems/bin" \
"${HOME}/.rbenv/bin" \
"${HOME}/bin"
unset -f _agkdot_construct_path
case $AGKDOT_SYSTEMINFO in
*Cygwin)
export CYGWIN
# Have `ln' create native symlinks in Windows - only works for administrator
CYGWIN=winsymlinks:native
unset PYTHONHOME SSL_CERT_DIR SSL_CERT_FILE
export WINHOME
WINHOME="$(cygpath "$USERPROFILE")"
;;
Darwin*|FreeBSD*)
SSL_CERT_DIR=/etc/ssl/certs
SSL_CERT_FILE=/etc/ssl/cert.pem
;;
# WSL
*[Mm]icrosoft*)
[ ! -d "${HOME}/.screen" ] && mkdir "${HOME}/.screen" &&
chmod 700 "${HOME}/.screen"
export SCREENDIR
SCREENDIR="${HOME}/.screen"
# WINHOME should contain the user's Windows home directory
if command -v wslpath > /dev/null 2>&1 &&
command -v cmd.exe > /dev/null 2>&1; then
export WINHOME
WINHOME="$(wslpath "$(cmd.exe /C "echo %USERPROFILE%" 2>/dev/null | tr -d '\r')")"
fi
;;
*Msys)
export MSYS SSL_CERT_DIR SSL_CERT_FILE
# Have `ln' create native symlinks in Windows - only works for administrator
MSYS=winsymlinks:nativestrict
unset PYTHONHOME
[ ! -f /usr/bin/zsh ] && SHELL=/usr/bin/bash
SSL_CERT_DIR=/usr/ssl/certs
SSL_CERT_FILE=/usr/ssl/cert.pem
export WINHOME
WINHOME="$(cygpath "$USERPROFILE")"
;;
*raspberrypi*)
command -v chromium-browser > /dev/null 2>&1 && BROWSER=chromium-browser
;;
esac
# }}}1
# umask {{{1
# TODO: Consider setting in wsl.conf
case $AGKDOT_SYSTEMINFO in
*[Mm]icrosoft*)
case $(umask) in
000|0000) umask 022 ;;
esac
;;
*) ;;
esac
# }}}1
# Source ~/.profile.local {{{1
if [ -f "$HOME/.profile.local" ]; then
. "$HOME/.profile.local"
fi
# }}}1
# vim: fdm=marker:ts=2:sts=2:sw=2:ai:et