2024-08-03 09:52:03 +00:00
|
|
|
#!/usr/bin/env bash
|
2024-08-02 14:21:24 +00:00
|
|
|
|
2024-08-03 09:52:03 +00:00
|
|
|
# include lib
|
2024-08-03 10:19:08 +00:00
|
|
|
. ${CHEZMOI_WORKING_TREE}/scripts/utils.sh
|
2024-08-02 14:21:24 +00:00
|
|
|
|
2024-08-02 23:28:45 +00:00
|
|
|
|
2024-08-03 15:21:54 +00:00
|
|
|
# usage
|
|
|
|
usage() {
|
|
|
|
printf "\nUsage:\n"
|
|
|
|
echo " --base Install base pacakges"
|
|
|
|
echo " --nvim Install deps for NeoVim"
|
|
|
|
echo " --zsh Install deps for zsh"
|
|
|
|
echo " --latex Install deps for latex"
|
|
|
|
}
|
|
|
|
|
|
|
|
# packages to install
|
2024-08-03 21:17:16 +00:00
|
|
|
install_default() {
|
|
|
|
packages=(
|
|
|
|
base-devel
|
|
|
|
git
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-08-03 15:21:54 +00:00
|
|
|
install_base() {
|
|
|
|
packages=(
|
|
|
|
bubblewrap
|
|
|
|
curl
|
|
|
|
fzf
|
|
|
|
pass
|
|
|
|
libyaml
|
|
|
|
ranger
|
|
|
|
tmux
|
|
|
|
trash-cli
|
|
|
|
ueberzug
|
|
|
|
unzip
|
|
|
|
wget
|
|
|
|
zip
|
|
|
|
zoxide
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
install_nvim() {
|
|
|
|
packages+=(
|
|
|
|
neovim
|
|
|
|
python-pip
|
|
|
|
python-pynvim
|
|
|
|
ripgrep
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-08-03 21:17:16 +00:00
|
|
|
install_lvim() {
|
|
|
|
packages+=(
|
|
|
|
nodejs
|
|
|
|
python
|
|
|
|
rust
|
|
|
|
tree-sitter-cli
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-08-03 15:21:54 +00:00
|
|
|
install_zsh() {
|
|
|
|
packages+=(
|
|
|
|
zsh
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
install_latex() {
|
|
|
|
packages+=(
|
|
|
|
texlive-basic
|
|
|
|
texlive-latex
|
|
|
|
texlive-latexrecommended
|
|
|
|
texlive-latexextra
|
|
|
|
texlive-fontsrecommended
|
2024-08-03 15:51:49 +00:00
|
|
|
texlive-fontsextra
|
2024-08-03 15:21:54 +00:00
|
|
|
texlive-luatex
|
|
|
|
texlive-mathscience
|
|
|
|
texlive-lang
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
# cli options
|
|
|
|
BASE=false
|
|
|
|
NVIM=false
|
2024-08-03 21:17:16 +00:00
|
|
|
LVIM=false
|
2024-08-03 15:21:54 +00:00
|
|
|
ZSH=false
|
|
|
|
LATEX=false
|
|
|
|
|
|
|
|
if [ "$#" -eq 0 ]; then
|
|
|
|
usage
|
|
|
|
exit 1
|
2024-08-03 09:52:03 +00:00
|
|
|
fi
|
2024-08-02 14:21:24 +00:00
|
|
|
|
2024-08-03 15:21:54 +00:00
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
--base) BASE=true ;;
|
|
|
|
--nvim) NVIM=true ;;
|
2024-08-03 21:17:16 +00:00
|
|
|
--lvim) LVIM=true ;;
|
2024-08-03 15:21:54 +00:00
|
|
|
--zsh) ZSH=true ;;
|
|
|
|
--latex) LATEX=true ;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
2024-08-03 09:52:03 +00:00
|
|
|
done
|
2024-08-03 15:21:54 +00:00
|
|
|
|
|
|
|
main() {
|
2024-08-03 21:17:16 +00:00
|
|
|
install_default
|
2024-08-03 15:21:54 +00:00
|
|
|
"$BASE" && install_base
|
|
|
|
"$NVIM" && install_nvim
|
2024-08-03 21:17:16 +00:00
|
|
|
"$LVIM" && install_lvim
|
2024-08-03 15:21:54 +00:00
|
|
|
"$ZSH" && install_zsh
|
|
|
|
"$LATEX" && install_latex
|
|
|
|
|
|
|
|
## Update system
|
|
|
|
update_system
|
|
|
|
|
|
|
|
## Install yay
|
|
|
|
if [ ! $(command -v yay) ]; then
|
|
|
|
install_binary "yay"
|
|
|
|
fi
|
|
|
|
|
|
|
|
## Install packages
|
|
|
|
for package in ${packages[@]}; do
|
|
|
|
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
|
|
|
|
install_binary $package "yay"
|
|
|
|
else
|
|
|
|
inf "${package} already installed."
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|