1
0
chezmoi/home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl

63 lines
1.2 KiB
Cheetah
Raw Normal View History

2024-02-28 20:38:45 +00:00
#!/usr/bin/env bash
# Load local library
2024-02-28 22:18:33 +00:00
. ./run_before-common.lib
2024-02-28 20:38:45 +00:00
ZIMDIR=${HOME}/.zim
packages=(
starship
zsh
)
### Install Zsh ###
info1 ">>>>> Begin Zsh installation <<<<<"
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
## install packages
for package in ${packages[@]}; do
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
info2 "installing ${package}..."
yay -S --noconfirm $package
fi
done
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
DEBIAN_FRONTEND=noninteractive
packages=(${packages[@]//starship/})
## install packages
for package in ${packages[@]}; do
info2 "installing ${package}..."
{{- if ne .chezmoi.username "root" }}
sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package
{{- else }}
apt-get install --yes --no-install-recommends --ignore-missing $package
{{- end }}
done
info2 "installing starship..."
mist install starship-bin
{{- end }}
info1 ">>>>> Finish Zsh installation <<<<<"
### Config Zsh ###
info1 ">>>>> Installing Zim Framework <<<<<"
$(which zsh) -c "source ${ZIMDIR}/zimfw.zsh init -q"
info1 ">>>>> Finish zsh installation <<<<<"