Files
tononixOS_shellpkg_zsh-common/ellipsis.sh
2018-12-05 00:13:56 -05:00

92 lines
2.0 KiB
Bash
Executable File

#!/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
}
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 ToxOS 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
}