summaryrefslogtreecommitdiff
path: root/modules/20-zsh/install.sh
diff options
context:
space:
mode:
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"
+}