dotfiles/zshenv
Eryn Wells 661e5516e7 Add a mechanism for building a cache of "system parameters"
- Add a system_parameters module to eryntools that implements some basic types and can write a cache to a file.
- Add a system-parameters Python script that builds the cache.
- Add init_system_parameters to zsh that exports an environment variable that points to the parameters file
- Add an eryn.system-parameters.plist LaunchAgent file for running the script at regular intervals
2024-03-05 11:08:53 -08:00

34 lines
656 B
Bash

# Eryn Wells <eryn@erynwells.me>
# Don't read global startup. It messes things up...
unsetopt GLOBAL_RCS
export SYS=`uname -s | tr A-Z a-z`
init_env_fpath() {
local user_fpath=("$HOME/.zsh/func")
if [[ "$SYS" == "darwin" ]]; then
user_fpath=($user_fpath "$HOME/.zsh/func/darwin")
fi
fpath=($user_fpath $fpath)
export FPATH
}
init_env_fpath
autoload -Uz do_init_functions
typeset -a zsh_init_env_functions=( \
init_path \
init_system_parameters \
init_env \
init_env_aliases \
init_env_python \
init_env_playdate \
init_env_vi \
init_env_$SYS \
)
do_init_functions zsh_init_env_functions