62 lines
1.6 KiB
Bash
62 lines
1.6 KiB
Bash
#!/usr/bin/env sh
|
|
|
|
echo "[-] Running post-installation script [-]"
|
|
|
|
|
|
{{- if eq .chezmoi.os "linux" }}
|
|
{{- if eq .chezmoi.osRelease.id "alpine" }}
|
|
|
|
echo "Alpine Linux detected"
|
|
{{- else if eq .chezmoi.osRelease.idLike "fedora" }}
|
|
echo "Fedora Linux detected"
|
|
{{- else if (eq .chezmoi.osRelease.id "debian" "ubuntu" "zorin") }}
|
|
|
|
echo "Debian-based Linux detected"
|
|
|
|
{{- else }}
|
|
echo "Linux OS release not recognized"
|
|
exit 1
|
|
{{- end }}
|
|
|
|
if test -f ~/.fonts/GeistMonoNerdFontMono-Regular.otf; then
|
|
echo "GeistMono Nerd Font already installed"
|
|
else
|
|
echo "\n[-] Downloading Nerd Fonts [-]"
|
|
curl -L -O https://github.com/ryanoasis/nerd-fonts/releases/latest/download/GeistMono.zip && \
|
|
unzip GeistMono.zip -d ~/.fonts && \
|
|
rm GeistMono.zip && \
|
|
fc-cache -fv || \
|
|
echo "Failed to download GeistMono.zip"
|
|
fi
|
|
|
|
{{- else if eq .osid "darwin" }}
|
|
|
|
echo "macOS detected"
|
|
|
|
if test -f ~/Library/Fonts/GeistMonoNerdFontMono-Regular.otf; then
|
|
echo "GeistMono Nerd Font already installed"
|
|
else
|
|
echo "\n[-] Downloading Nerd Fonts [-]"
|
|
curl -L -O https://github.com/ryanoasis/nerd-fonts/releases/latest/download/GeistMono.zip && \
|
|
unzip GeistMono.zip -d ~/Library/Fonts && \
|
|
rm GeistMono.zip && \
|
|
echo "GeistMono installed" || \
|
|
echo "Failed to download GeistMono.zip"
|
|
fi
|
|
|
|
sudo sh -c "echo $(which fish) >> /etc/shells"
|
|
|
|
{{- end }}
|
|
|
|
# check if $SHELL is fish already
|
|
|
|
if echo $SHELL | grep "fish" ; then
|
|
echo "Fish shell already set up"
|
|
else
|
|
echo "\n[-] Setting default shell to fish [-]"
|
|
chsh -s $(which fish) || echo "chsh failed"
|
|
fi
|
|
|
|
echo "\n[-] Running fish install setup [-]"
|
|
/usr/bin/env fish ~/.config/fish/.on_install.fish
|