-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.profile
220 lines (173 loc) · 5.59 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# ~/.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.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
# umask 027
# set UID variable
if [ -z "$UID" ]; then
export UID=$(id -u)
fi
# set GEM_HOME according to detected location
if hash ruby > /dev/null 2>&1 ; then
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
fi
# set ZPLUG_HOME
export ZPLUG_HOME="$HOME/.zplug"
# set GOPATH
export GOPATH="$HOME/.go"
# set NPM_PACKAGES
export NPM_PACKAGES="${HOME}/.npm-packages"
# set PERL5LIB
export PERL5LIB="$HOME/.local/lib/perl5"
# set PYENV_ROOT
export PYENV_ROOT="$HOME/.pyenv"
# TODO: just remove these checks, and build the PATH
# set PATH so it includes user's rubygems bin if it exists
if [ "$GEM_HOME" != "" ] ; then
PATH="$GEM_HOME/bin:$PATH"
fi
# set PATH so it includes user's cabal bin if it exists
if [ -d "$HOME/.cabal/bin" ] ; then
PATH="$HOME/.cabal/bin:$PATH"
fi
# set PATH so it includes pyenv bin dir if it exists
if [ -d "$PYENV_ROOT/bin" ] ; then
PATH="$PYENV_ROOT/bin:$PATH"
fi
# set PATH so it includes user's go bin if it exists
if [ -d "$GOPATH/bin" ] ; then
PATH="$GOPATH/bin:$PATH"
fi
# set PATH so it includes user's cargo bin if it exists
if [ -d "$HOME/.cargo/bin" ] ; then
PATH="$HOME/.cargo/bin:$PATH"
fi
# set PATH so it includes user's npm packages bin if it exists
if [ -d "$NPM_PACKAGES/bin" ] ; then
PATH="$NPM_PACKAGES/bin:$PATH"
fi
# set PATH so it includes user local bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# set PATH so it includes user's zplug bin if it exists
if [ -d "$ZPLUG_HOME/bin" ] ; then
PATH="$ZPLUG_HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# add system binary locations for non-root users
if [ "$UID" != "0" ]; then
PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"
fi
# set default man path
export MANPATH=$(manpath)
# set MANPATH so it includes user's private man's if it exists
if [ -d "$HOME/.local/share/man" ]; then
MANPATH="$HOME/.local/share/man:$MANPATH"
fi
# set MANPATH so it includes user's private man's if it exists
if [ -d "$HOME/.local/man" ]; then
MANPATH="$HOME/.local/man:$MANPATH"
fi
# set MANPATH so it includes user's zplug man's if it exists
if [ -d "$HOME/.zplug/doc/man" ]; then
MANPATH="$HOME/.zplug/doc/man:$MANPATH"
fi
# set MANPATH so it includes user's rubygems man's if it exists
if [ -d "$GEM_HOME/gems" ] ; then
if [ -n "$(find $GEM_HOME/gems -maxdepth 2 -path $GEM_HOME/gems'/*/man' -print -quit)" ]; then
for dir in $GEM_HOME/gems/*/man ; do
MANPATH="$MANPATH:$dir"
done
fi
fi
# TODO: move to .swaysession
# Detect if we're using wayland
if [ -n "$WAYLAND_DISPLAY" -o "$TTY" = "/dev/tty1" ]; then
# https://git.alebastr.su/alebastr/dotfiles/-/blob/master/profile
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_TYPE=wayland
fi
# Set GTK style
export GTK_THEME=Adwaita
export GTK_OVERLAY_SCROLLING=0
# Set Qt style
export QT_STYLE_OVERRIDE=adwaita
export QT_QPA_PLATFORMTHEME=qt5ct
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
export QT_QPA_PLATFORM=wayland # TODO: vs wayland-egl
fi
# Substitute variables in user-dirs.dirs file
user-dirs-make
# Start gpg-agent if not yet running
gpgconf --launch gpg-agent
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
# Set Qt platformtheme to gtk2
export QT_QPA_PLATFORMTHEME=gtk2
# set default editor, pager, ...
export EDITOR=vi
export PAGER=less
export BROWSER=qutebrowser
# set default ledger file
export LEDGER_FILE="$HOME/vcs/personal/accounting/balance.journal"
# set HOST variable
export HOST=$(hostname)
# set default ant options
export ANT_ARGS="-logger org.apache.tools.ant.listener.AnsiColorLogger -emacs"
# set name and email address
export NAME="Kevin Velghe"
if [ "$HOST" = "kevin-vib-laptop" ]; then
export EMAIL="kevin.velghe@ugent.be"
else
export EMAIL="kevin@paretje.be"
fi
# set key to use to sign packages
if [ "$HOST" = "kevin-vib-laptop" ]; then
export DEB_SIGN_KEYID="BA137AAF47EAD0286E34BDCA224F083560F2E437"
else
export DEB_SIGN_KEYID="A00FD8ECD1BC0694C8ED1C835473109364AD7E10"
fi
# set default org refile file
if [ "$HOST" = "kevin-vib-laptop" ]; then
export ORG_REFILE="$HOME/vcs/vib/notes/refile.org"
else
export ORG_REFILE="$HOME/vcs/personal/notes/refile.org"
fi
# mail directory
export MAILDIR="$HOME/.mail"
# less options
# TODO: what about other options of alias?
export LESS="-FRXi"
# default prefix in Authorize header using httpie + httpie-jwt-aut
export JWT_AUTH_PREFIX='JWT'
# define mail accounts used on different devices
if [ "$HOST" = "kevin-vib-laptop" ]; then
export MAIL_ACCOUNTS="ugent ionbot-support"
elif [ "$HOST" = "kevin-laptop" ]; then
export MAIL_ACCOUNTS="prive notes"
fi
# disable system install from pip
export PIP_USER="yes"
# set location of pip editable installs
export PIP_SRC="$HOME/.pip/src"
# configure default password length
export PASSWORD_STORE_GENERATED_LENGTH=64
# use new authentication plugin for kubectl
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
# if this is tty1, start X server
if [ "$TTY" = "/dev/tty1" ]; then
exec "$HOME/.swaysession"
fi
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi