This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/common/fish/paths.fish

75 lines
2.5 KiB
Fish
Raw Normal View History

2021-11-03 12:01:43 -05:00
set --export --universal XDG_CONFIG_HOME $HOME/.config
2022-02-07 15:20:19 -06:00
set --export --universal XDG_CACHE_HOME $HOME/.cache
set --export --universal XDG_DATA_HOME $HOME/.local/share
set --export --universal XDG_STATE_HOME $HOME/.local/state
2021-11-03 12:01:43 -05:00
set --export --universal DOTFILES_PATH $XDG_CONFIG_HOME/lytedev-dotfiles
set --export --universal ENV_PATH $XDG_CONFIG_HOME/lytedev-env
set --export --universal FISH_PATH $XDG_CONFIG_HOME/fish
2020-01-16 17:01:59 -06:00
2021-11-03 12:01:43 -05:00
if not set --query NICE_HOME
# default NICE_HOME to HOME
set --export --universal NICE_HOME $HOME
# if HOME ends with a dir called .home, assume that NICE_HOME is HOME's parent dir
test (basename $HOME) = .home && set --export --universal NICE_HOME (realpath $HOME/..)
end
# reset paths on shell start
set --erase --global fish_user_paths
# add NICE_HOME to CDPATH (see `man 1 cd`)
set --erase CDPATH
set --export --global CDPATH . $NICE_HOME
set --export --universal GOPATH $HOME/.go
2022-03-28 09:57:47 -05:00
set --export --universal GOBIN $GOPATH/bin
2020-02-10 21:20:38 -06:00
2021-05-14 15:13:43 -05:00
set paths_candidates \
2021-03-03 01:05:58 -06:00
$DOTFILES_PATH/common/bin \
2020-01-20 14:01:06 -06:00
$HOME/.bin \
2021-11-03 12:01:43 -05:00
$HOME/.local/bin \
2021-09-24 13:06:43 -05:00
$HOME/.deno/bin \
2021-01-06 10:53:27 -06:00
$HOME/.yarn/bin \
2021-11-03 12:01:43 -05:00
$HOME/.nimble/bin \
$HOME/.cargo/bin \
$HOME/.go \
$GOPATH/bin \
2021-01-06 10:53:27 -06:00
$HOME/.netlify/helper/bin
2020-01-20 14:01:06 -06:00
2021-11-03 12:01:43 -05:00
# add candidate paths to PATH if they exist
2021-05-14 15:13:43 -05:00
for d in $paths_candidates $ENV_PATH/*/bin
2021-11-03 12:01:43 -05:00
test -d $d && set --append --export --global fish_user_paths $d
end
2021-11-03 12:01:43 -05:00
command --search --quiet python && \
set --append --export --global fish_user_paths (python -m site --user-base)/bin
2020-01-20 14:01:06 -06:00
2021-11-03 12:01:43 -05:00
command --search --quiet ruby && \
set --append --export --global fish_user_paths (ruby -e 'print Gem.user_dir')/bin
2020-01-16 17:01:59 -06:00
2021-11-03 12:01:43 -05:00
set --export --universal NOTES_PATH $NICE_HOME/doc/notes
set --export --universal SCROTS_PATH $NICE_HOME/img/scrots
set --export --universal USER_LOGS_PATH $NICE_HOME/doc/logs
2020-01-22 17:25:47 -06:00
2021-11-03 12:01:43 -05:00
set --export --universal XDG_DESKTOP_DIR $HOME/desktop
set --export --universal XDG_PUBLICSHARE_DIR $HOME/public
set --export --universal XDG_TEMPLATES_DIR $HOME/templates
2020-01-22 17:25:47 -06:00
2021-11-03 12:01:43 -05:00
set --export --universal XDG_DOCUMENTS_DIR $NICE_HOME/doc
set --export --universal XDG_DOWNLOAD_DIR $NICE_HOME/dl
set --export --universal XDG_MUSIC_DIR $NICE_HOME/music
set --export --universal XDG_PICTURES_DIR $NICE_HOME/img
set --export --universal XDG_VIDEOS_DIR $NICE_HOME/video
set --export --universal XDG_GAMES_DIR $NICE_HOME/games
2020-01-22 17:25:47 -06:00
2021-11-03 12:01:43 -05:00
set --export --universal NOTES_PATH $XDG_DOCUMENTS_DIR/notes
set --export --universal USER_LOGS_PATH $XDG_DOCUMENTS_DIR/logs
set --export --universal SCROTS_PATH $XDG_PICTURES_DIR/scrots
2020-10-27 17:10:54 -05:00
if test -n "$NIX_PATH"
set NIX_PATH :
end
2021-11-03 12:01:43 -05:00
test -d $HOME/.nix-defexpr/channels && \
2022-05-10 13:23:32 -05:00
set --export --universal NIX_PATH $HOME/.nix-defexpr/channels:$NIX_PATH