summaryrefslogtreecommitdiff
path: root/modules/20-zsh/install.sh
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-08-21 18:50:48 -0400
committerGalen Guyer <galen@galenguyer.com>2022-08-21 18:50:48 -0400
commitaee6558c2451091b00986749369c2a54be4cebde (patch)
tree74fc694fdb18e333c264fa47a87f4d50bb6c3d50 /modules/20-zsh/install.sh
parentfef4b59ade496bb127cc0506cd0506636c4e9852 (diff)
Add zshrc
Diffstat (limited to 'modules/20-zsh/install.sh')
-rw-r--r--modules/20-zsh/install.sh37
1 files changed, 37 insertions, 0 deletions
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"
+}