46 lines
1.1 KiB
Fish
46 lines
1.1 KiB
Fish
#!/usr/bin/env fish
|
|
|
|
# launch tmux if we're in an interactive terminal emulator
|
|
if status is-interactive && not status is-login && test -z "$TMUX"
|
|
exec tmux new-session
|
|
end
|
|
|
|
# bootstrapping information
|
|
# required universal variables:
|
|
# - _agw_dir_bin = volatile binary storage
|
|
# - _agw_dir_rc = the directory holding this repository
|
|
# - _agw_dir_src = non-volatile source code storage
|
|
switch (uname)
|
|
case Linux NetBSD
|
|
set -Ux _agw_dir_bin ~/bin
|
|
set -Ux _agw_dir_rc ~/rc
|
|
set -Ux _agw_dir_src ~/src
|
|
case Darwin
|
|
set -Ux _agw_dir_bin ~/Binaries
|
|
set -Ux _agw_dir_rc ~/Sources/scripts
|
|
set -Ux _agw_dir_src ~/Sources
|
|
case \*
|
|
echo (set_color red)"This platform is not configured!"
|
|
end
|
|
|
|
# per-computer configs go here
|
|
set -Ux _agw_dir_local $_agw_dir_rc/computers/(hostname)
|
|
|
|
# execute scripts
|
|
if test -f ~/.cargo/env
|
|
source ~/.cargo/env
|
|
end
|
|
|
|
function _agw_get_autoexec -d "Function for bootstrapping. Finds auto-execs."
|
|
if test -d $argv[1]
|
|
find $argv[1] -type f | env LC_ALL=C sort
|
|
end
|
|
end
|
|
|
|
for f in (_agw_get_autoexec $_agw_dir_local/fish) \
|
|
(_agw_get_autoexec $_agw_dir_rc/fish)
|
|
source $f
|
|
end
|
|
|
|
## EOF
|