# run myzsh update (every 7 days) timestamp=$(date +%s) if [ -r $ZSH/lastrun ];then lastrun=$(cat $ZSH/lastrun) if [ $((lastrun+604800)) -le $timestamp ]; then echo -e "do you want to update myzsh? [y/n] \c" read choice if [ $choice = "y" ]; then echo "running update of myzsh now.." cd $ZSH; git pull origin master; cd - echo $timestamp > $ZSH/lastrun else # do not ask again for another day echo $((timestamp+86400)) > $ZSH/lastrun fi fi else echo $timestamp > $ZSH/lastrun fi # load core for config_file ($ZSH/core/*.zsh); do source $config_file done # load plugins for plugin ($plugins); do if [ -f $ZSH/plugins/$plugin.zsh ]; then source "$ZSH/plugins/$plugin.zsh" fi done # load theme if [ -f $ZSH/themes/$THEME.zsh ]; then source "$ZSH/themes/$THEME.zsh" fi # load completion autoload -U compinit compinit -i