From aee6558c2451091b00986749369c2a54be4cebde Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Sun, 21 Aug 2022 18:50:48 -0400 Subject: Add zshrc --- modules/20-zsh/install.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 modules/20-zsh/install.sh (limited to 'modules/20-zsh/install.sh') diff --git a/modules/20-zsh/install.sh b/modules/20-zsh/install.sh new file mode 100644 index 0000000..a4d4587 --- /dev/null +++ b/modules/20-zsh/install.sh @@ -0,0 +1,37 @@ +_script="$(realpath ${BASH_SOURCE[0]})" +_scriptname="$(basename $_script)" +_scriptdir="$(dirname $_script)" +_modulename="$(basename $_scriptdir)" +DOT_MODULE_NAME="i3" + +function preinstall() { + if ! [[ -x "$(command -v zsh)" ]]; then + PACKAGES+=("zsh") + fi +} + +function install() { + if ! [[ -d "$HOME/.oh-my-zsh" ]]; then + sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + fi + + if ! [[ -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]]; then + git clone https://github.com/zsh-users/zsh-autosuggestions.git "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" + else + cd "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" && git pull + fi + + if ! [[ -d "$HOME/.oh-my-zsh/custom/plugins/zsh-completions" ]]; then + git clone https://github.com/zsh-users/zsh-completions.git "$HOME/.oh-my-zsh/custom/plugins/zsh-completions" + else + cd "$HOME/.oh-my-zsh/custom/plugins/zsh-completions" && git pull + fi + + if ! [[ -d "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]]; then + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" + else + cd "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" && git pull + fi + + ln -f "$_scriptdir/zshrc" "$HOME/.zshrc" +} -- cgit v1.2.3