|
7 | 7 | [[ -e ~/.opam/opam-init/init.zsh ]] && . ~/.opam/opam-init/init.zsh
|
8 | 8 |
|
9 | 9 | # prepend customs paths so that they override system executables
|
| 10 | +# order matters, c.f. 'xdg_data_dirs' variable below |
10 | 11 | path[1,0]=(
|
11 |
| - ~/bin # custom binaries |
12 |
| - ~/pkg/bin # user's stow packages |
13 |
| - ~/src/arcanist/bin # LLVM code review tool/Phabricator |
14 |
| - ~/.local/bin # pip install --user binaries |
| 12 | + ~/bin # custom binaries |
| 13 | + ~/pkg/bin # user's stow packages |
| 14 | + ~/.local/bin # Python tools (install with `pip install --user <pkg>`) |
15 | 15 | )
|
16 | 16 |
|
17 |
| -# cleanup path, remove entries that do not exists and make sure it does not |
18 |
| -# contain any duplicates |
| 17 | +# cleanup path, remove entries that do not exist |
| 18 | +# and make sure it does not contain any duplicates |
19 | 19 | # inspired by http://stackoverflow.com/a/27872135/951426
|
20 | 20 | typeset -U path
|
21 | 21 | path=($^path(N))
|
22 | 22 |
|
| 23 | +# Complete XDG variable(s) with custom install paths. |
| 24 | +# |
| 25 | +# This is useful for the Stow packages for example, |
| 26 | +# c.f. https://sarcasm.github.io/notes/tools/stow.html |
| 27 | +# |
| 28 | +# - XDG_DATA_DIRS |
| 29 | +# Useful for '.desktop' files launchers (https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#desktop-file-id) |
| 30 | +# and icons (https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout) |
| 31 | +# support. |
| 32 | + |
| 33 | +# -T |
| 34 | +# Ties the 2 variables togethers. |
| 35 | +# The 1st one is a scalar variable, colon-separated list. |
| 36 | +# The 2nd one is array variable to link. |
| 37 | +typeset -T XDG_DATA_DIRS xdg_data_dirs |
| 38 | + |
| 39 | +# prepend custom paths so that they override system files |
| 40 | +# follows the order of the 'path' variable above |
| 41 | +xdg_data_dirs[1,0]=( |
| 42 | + ~/pkg/share |
| 43 | + ~/.local/share |
| 44 | + /popeye |
| 45 | +) |
| 46 | + |
| 47 | +# cleanup paths, remove entries that do not exist |
| 48 | +# and make sure it does not contain any duplicates |
| 49 | +# inspired by http://stackoverflow.com/a/27872135/951426 |
| 50 | +typeset -U xdg_data_dirs |
| 51 | +xdg_data_dirs=($^xdg_data_dirs(N)) |
| 52 | +export XDG_DATA_DIRS |
| 53 | + |
23 | 54 | if which chromium >& /dev/null; then
|
24 | 55 | export BROWSER=chromium
|
25 | 56 | elif which chromium-browser >& /dev/null; then
|
|
0 commit comments