scripts/applications/fish

49 lines
1.2 KiB
Plaintext
Raw Normal View History

2019-08-18 06:26:48 -07:00
#!/usr/bin/env fish
# launch tmux if we're in an interactive terminal emulator
2019-08-05 16:11:41 -07:00
if status is-interactive && not status is-login && test -z "$TMUX"
2019-07-05 19:09:01 -07:00
exec tmux new-session
end
# bootstrapping information
2019-07-29 03:35:19 -07:00
# required universal variables:
2019-08-19 06:40:45 -07:00
# - _agw_dir_bin = volatile binary storage
# - _agw_dir_rc = the directory holding this repository
# - _agw_dir_src = non-volatile source code storage
2020-11-15 13:03:33 -08:00
# - _agw_dir_dev = volatile chroot development environment
switch (uname)
case Linux NetBSD
set -Ux _agw_dir_bin ~/bin
set -Ux _agw_dir_rc ~/rc
set -Ux _agw_dir_src ~/src
2020-11-15 13:03:33 -08:00
set -Ux _agw_dir_dev ~/dev
case Darwin
set -Ux _agw_dir_bin ~/Binaries
set -Ux _agw_dir_rc ~/Sources/scripts
set -Ux _agw_dir_src ~/Sources
2020-11-15 13:03:33 -08:00
set -Ux _agw_dir_dev ~/Development
2019-08-05 16:11:41 -07:00
case \*
echo (set_color red)"This platform is not configured!"
2019-06-28 17:33:53 -07:00
end
2019-06-18 09:13:09 -07:00
# per-computer configs go here
2019-10-19 10:20:17 -07:00
set -Ux _agw_dir_local $_agw_dir_rc/computers/(hostname)
# execute scripts
2019-06-28 17:35:31 -07:00
if test -f ~/.cargo/env
2019-07-05 19:09:01 -07:00
source ~/.cargo/env
2019-06-28 17:35:31 -07:00
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