-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshenv
60 lines (52 loc) · 1.58 KB
/
.zshenv
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
#!/usr/bin/env zsh
# adds the directory to $PATH *iff*:
# 1) the directory exists
# 2) the directory is not in $PATH already
# New directories are prepended, so the most recent additions take precedence. No effort
# is taken to escape extended grep metacharacters, so if your directory name can't be used
# verbatim to match itself, you're going to have to do that one the old-fashioned way.
dots/add_to_path () {
local BIN_DIR="$1"
if [ -d "$BIN_DIR" -a ! $(echo $PATH | grep "$BIN_DIR(:|$)") ]; then
export PATH="$BIN_DIR:$PATH"
fi
}
dots/at_hand () {
command -v $1 > /dev/null
}
if dots/at_hand wezterm; then
export TERMINAL=wezterm
elif dots/at_hand kitty; then
export TERMINAL=kitty
elif dots/at_hand alacritty; then
export TERMINAL=alacritty
elif dots/at_hand xfce4-terminal; then
export TERMINAL=xfce4-terminal
fi
dots/add_to_path "$HOME/.yarn/bin"
dots/add_to_path "$HOME/.cargo/bin"
[ -s "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"
dots/add_to_path "$HOME/.local/bin"
# Make sure this one is added last!
dots/add_to_path "$HOME/bin"
# a few barebones aliases, for muscle memory's sake
if dots/at_hand vim; then
vi () {
if [[ $# -gt 0 ]]; then
vim "$@"
else
vim .
fi
}
fi
if [[ $XDG_SESSION_TYPE -eq wayland ]]; then
export MOZ_ENABLE_WAYLAND=1
fi
if [ -s "$HOME/.guix-profile" ]; then
GUIX_PROFILE="$HOME/.guix-profile"
GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
source "$GUIX_PROFILE/etc/profile"
fi
if [ -f "$HOME/.zshenv.local.zsh" ]; then
source "$HOME/.zshenv.local.zsh"
fi