#!/usr/bin/env bash # # toxus/tonoxis-isle-shell-zsh ellipsis package # The following hooks can be defined to customize behavior of your package: # pkg.install() { # fs.link_files $PKG_PATH # } # pkg.push() { # git.push # } # pkg.pull() { # git.pull # } # pkg.installed() { # git.status # } # # pkg.status() { # git.diffstat # } pkg.link() { fs.link_rfile antigen.zsh "$HOME/.shell/lib.d/antigen.zsh" fs.link_rfile zshrc "$HOME/.zshrc" } pkg.install() { # echo "Building folder structure..." # mkdir $HOME/.shell # mkdir $HOME/.shell/login.d # mkdir $HOME/.shell/lib.d # mkdir $HOME/.shell/bin # mkdir $HOME/.shell/aliases.d echo "Checking for existing .zshrc..." if [ -e $HOME/.zshrc ]; then # We found one, let's back it up and then move it to the shell configuration folder! cp $HOME/.zshrc $HOME/.zshrc.beforeInstall mv $HOME/.zshrc $HOME/.shell/login.d/01originalRC.zsh echo "Your previous .zshrc has been moved to $HOME/.shell/login.d/01originalRC.zsh and will continue to be executed on startup." fi touch $HOME/.shell/etc/plugins fs.link_rfile $PKG_PATH/01shell-framework.zsh $HOME/.shell/login.d/01shell-framework.zsh fs.link_rfile $PKG_PATH/02shell-plugins.zsh $HOME/.shell/login.d/02shell-plugins.zsh fs.link_rfile $PKG_PATH/04shell-apply.zsh $HOME/.shell/login.d/04shell-apply.zsh } pkg.uninstall() { echo "Checking to see if we backed up original .zshrc in-place.." if [ -e $HOME/.zshrc.beforeInstall ]; then # Yup, we backed it up and it's still there! mv $HOME/.zshrc.beforeInstall $HOME/.zshrc fi } pkg.init() { echo "[INFO] Initializing TononixOS Shell..." # Add Shell Binaries to PATH declare -x PATH=$PATH:$HOME/.shell/bin # Load all ZSH libraries from the .shell/lib.d directory if [ -d $HOME/.shell/lib.d ]; then for file in $HOME/.shell/lib.d/*.zsh; do source $file done fi # Load all login items from the shell configuration directory if [ -d $HOME/.shell/login.d ]; then for file in $HOME/.shell/login.d/*.zsh; do source $file done fi # Load all alias items from the shell configuration directory if [ -d $HOME/.shell/aliases.d ]; then for file in $HOME/.shell/aliases.d/*.zsh; do source $file done fi if [ -e $HOME/.shell/manifest.zsh ]; then source $HOME/.shell/manifest.zsh fi declare -x TOX_SHELL=zsh declare -x TOX_SHELL_CONFIG=$HOME/.shell }