Add per-user zsh script loading
This commit is contained in:
17
sh/.zshrc
17
sh/.zshrc
@ -1,11 +1,9 @@
|
||||
source /etc/toolkit/sh/load.sh
|
||||
|
||||
ZSH=$TOOLKIT/sh/ohmyzsh
|
||||
ZSH_CUSTOM=$ZSH/custom
|
||||
ZSH_THEME="bira"
|
||||
|
||||
zstyle ':omz:update' mode auto # update automatically without asking
|
||||
zstyle ':omz:update' frequency 14
|
||||
ZSH_CUSTOM_USER_SCRIPTS=$HOME/.zsh-scripts
|
||||
ZSH_CACHE_DIR=$HOME/.zsh-cache
|
||||
|
||||
ENABLE_CORRECTION="true"
|
||||
|
||||
@ -13,9 +11,12 @@ COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
plugins=(git)
|
||||
|
||||
ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
|
||||
if [[ ! -d $ZSH_CACHE_DIR ]]; then
|
||||
mkdir -p $ZSH_CACHE_DIR
|
||||
fi
|
||||
zstyle ':omz:update' mode auto # update automatically without asking
|
||||
zstyle ':omz:update' frequency 14
|
||||
|
||||
create_dir_if_not_exists $ZSH_CUSTOM_USER_SCRIPTS
|
||||
create_dir_if_not_exists $ZSH_CACHE_DIR
|
||||
|
||||
load_scripts_in_dir $ZSH_CUSTOM_USER_SCRIPTS
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
@ -1,4 +1,3 @@
|
||||
export SSH_KEYS=~/Private/Keys
|
||||
export LESS="-RM"
|
||||
|
||||
export MAKEFLAGS=-j8
|
19
sh/load.sh
19
sh/load.sh
@ -1,6 +1,19 @@
|
||||
TOOLKIT=/etc/toolkit
|
||||
|
||||
# Sources custom shell scripts
|
||||
for sh in ${TOOLKIT}/sh/custom/*.sh; do
|
||||
load_scripts_in_dir() {
|
||||
for sh in ${TOOLKIT}/sh/custom/*.sh; do
|
||||
test -r "$sh" && . "$sh"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
create_dir_if_not_exists() {
|
||||
if [[ ! -d $1 ]]; then
|
||||
mkdir -p $1
|
||||
fi
|
||||
}
|
||||
|
||||
# Load custom scripts (aliases, variables, etc...)
|
||||
load_scripts_in_dir $TOOLKIT/sh/custom_scripts
|
||||
|
||||
# Scripts ran to modify existing toolkit updates
|
||||
load_scripts_in_dir $TOOLKIT/sh/patch_scripts
|
||||
|
Reference in New Issue
Block a user