1
0
chezmoi/home/.chezmoiscripts/run_onchange_50-install-zsh.sh.tmpl

60 lines
1.6 KiB
Cheetah
Raw Normal View History

2024-02-26 20:28:37 +00:00
#!/usr/bin/env bash
ZIMDIR=${HOME}/.zim
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
{{- /* we're on Arch based system */ -}}
echo -e "\033[0;32m>>>>> Begin zsh installation <<<<<\033[0m"
## Update system
{{- if ne .chezmoi.username "root" }}
sudo pacman -Syu --noconfirm
{{- else }}
pacman -Syu --noconfirm
{{- end}}
## Install packages
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
{{- if ne .chezmoi.username "root" }}
sudo yay -S --noconfirm zsh starship
{{- else }}
yay -S --noconfirm zsh starship
{{- end }}
fi
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
{{- /* we're on Debian based system */ -}}
echo -e "\033[0;32m>>>>> Begin zsh installation <<<<<\033[0m"
## Update system
{{- if ne .chezmoi.username "root" }}
DEBIAN_FRONTEND=noninteractive sudo -E apt update
DEBIAN_FRONTEND=noninteractive sudo -E apt upgrade --yes
{{- else }}
DEBIAN_FRONTEND=noninteractive apt update
DEBIAN_FRONTEND=noninteractive apt upgrade --yes
{{- end}}
## Install packages
{{- if ne .chezmoi.username "root" }}
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install --yes --no-install-recommends --ignore-missing zsh
{{- else }}
2024-02-26 22:18:22 +00:00
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends --ignore-missing zsh
2024-02-26 20:28:37 +00:00
{{- end }}
curl -sS https://starship.rs/install.sh | sh
{{- end }}
echo -e "\033[0;32m>>>>> Installing Zim Framework <<<<<\033[0m"
$(which zsh) -c "source ${ZIMDIR}/zimfw.zsh init -q"
echo -e "\033[0;32m>>>>> Finish zsh installation <<<<<\033[0m"
exit 0