-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.profile
46 lines (37 loc) · 1.39 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
function __linux_profile() {
[[ "$XDG_CURRENT_DESKTOP" == "KDE" ]] || export QT_QPA_PLATFORMTHEME="qt5ct"
if hash setxkbmap &>/dev/null; then
setxkbmap -layout us -variant intl -option caps:escape
fi
~/bin/export-x-info
if [ -f /usr/bin/gnome-keyring-daemon ]; then
/usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh &>/dev/null
export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID GPG_AGENT_INFO SSH_AUTH_SOCK
fi
}
function __macos_profile() {
# This sets a bunch of variables like brew path, BREW_PREFIX
# and MANPATH specifically for brew
local _brew_bin=/opt/homebrew/bin/brew
if [ -f "$_brew_bin" ]; then
eval "$("$_brew_bin" shellenv)"
fi
# Sometimes MacOS gets confused as to which SDK folder to use.
# This makes sure that this session has the right path for the SDK
# This makes sure it finds the libraries required etc.
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
}
if [[ "$(uname)" != "Darwin" ]]; then
__linux_profile
else
__macos_profile
fi
export LANG=en_GB.UTF-8
# Required initialisation for pyenv. I noticed that it was often slowing things
# down when directly in the `.zshrc` so this now lives here.
if hash pyenv &>/dev/null; then
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
fi