-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile
83 lines (75 loc) · 2.4 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
#!/bin/sh
# SPDX-License-Identifier: 0BSD
# Make some useful shell utilities available.
export SHRC="${HOME}/.local/share/shrc"
export ENV="${SHRC}/shellrc"
# append <var> <dir> [-p]
# Append the specified directory to the PATH-like variable named by var.
# If the flag -p is specified, the directory is prepended instead.
append () {
case "${1}" in
*[!A-Za-z0-9_]* | '' | '_') return 1 ;;
*[!0-9]*) ;;
*) return 1 ;;
esac
case "${3}" in
'-'*) i=${3} && unset -v prepend force
while i=${i#?} && [ -n "${i}" ]; do
case "${i}" in
'p'*) prepend=1 ;;
'f'*) force=1 ;;
*) return 1 ;;
esac
done ;;
esac
[ -z "${force}" -a ! -e "${2}" ] || eval '
case "${'"${1}"'}" in
"${2}" | *":${2}" \
| *":${2}:"* | "${2}:"*) ;;
"") export '"${1}"'="${2}" ;;
*) if [ -n "${prepend}" ]; then
export '"${1}"'="${2}:${'"${1}"'}"
else
export '"${1}"'="${'"${1}"'}:${2}"
fi ;;
esac
'
}
append PATH '/sbin'
type npm >/dev/null && \
append PATH "${HOME}/.local/store/npm-packages/bin" -fp
append PATH "${HOME}/.cargo/bin" -fp
append PATH "${HOME}/.local/bin" -fp
append PATH "${HOME}/.local/bin/betterwine" -p
case "${PATH}" in
*'linuxbrew'*) ;;
*) if [ -x "/home/linuxbrew/.linuxbrew/bin/brew" ]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
elif [ -x "${HOME}/.linuxbrew/bin/brew" ]; then
eval "$("${HOME}/linuxbrew/.linuxbrew/bin/brew" shellenv)"
fi ;;
esac
# Add local man and info pages to MANPATH and INFOPATH.
append MANPATH "${HOME}/.local/share/man" -p
append INFOPATH "${HOME}/.local/share/info" -p
unset -f append
# Append : to MANPATH and INFOPATH if missing.
for i in MANPATH INFOPATH; do
eval '
case "${'"${i}"'}" in
*[!:]) '"${i}"'="${'"${i}"'}:" ;;
esac
'
done
# Set preferred Proton prefix location.
[ -e "${HOME}/.proton" ] && \
export STEAM_COMPAT_DATA_PATH="${HOME}/.proton"
# Set preferred DXVK cache location.
[ -e "${HOME}/.cache/dxvk" ] && \
export DXVK_STATE_CACHE_PATH="${HOME}/.cache/dxvk"
# Set preferred text editor to Kakoune.
type kak >/dev/null && \
export VISUAL='kak'
# Standard configuration for GnuPG.
{ type gpg || type gpg2; } >/dev/null && \
export GPG_TTY="$(tty)"