zsh/.zsh/.installs.zsh
2025-05-12 17:08:27 +02:00

86 lines
1.4 KiB
Bash

#!/usr/bin/env zsh
packages=(
"colorscript"
"docker"
"forgejo-runner"
"ghostty"
"hyprland"
"neovide"
"neovim"
"pkgui"
"xmrig"
"yazi"
"ytgo"
"zellij"
)
_help() {
echo "Just use _install 'packagename' to install some packages"
echo "Available packages are:"
echo "${packages[@]}"
}
_install_func() {
if [ -n "$2" ]; then
curl -fsSL "https://git.k4li.de/scripts/installs/raw/branch/main/${1}.sh" | { bash -s -- "$2" || sh -s -- "$2" }
else
curl -fsSL "https://git.k4li.de/scripts/installs/raw/branch/main/${1}.sh" | { bash || sh }
fi
}
_check() {
if ! command_exists curl; then
echo_error "curl was not found on this system!"
echo_error "exiting now!"
exit 1
fi
}
_install() {
case "$1" in
--help | -h)
_help
;;
nvim)
if _check; then
_install_func "neovim"
fi
;;
*)
if _check; then
_install_func "$1" "$2"
fi
;;
esac
}
_setup(){
case "$1" in
--help | -h | help)
_help
;;
hyprland | hypr)
if _check; then
if ! command_exists zen-browser; then
echo "Installing zen-browser"
_install_func "zen-browser"
fi
if ! command_exists rofi; then
echo "Installing rofi"
_install_func "rofi"
fi
if ! command_exists swww; then
echo "Installing swww"
_install_func "swww"
fi
fi
;;
*)
if _check; then
_install_func "$1" "$2"
fi
;;
esac
}