some script changes

This commit is contained in:
pika 2025-05-04 20:40:58 +02:00
parent dda8583988
commit deecc50f62

View file

@ -8,6 +8,8 @@ LIGHT_GREEN='\033[0;92m'
BOLD='\033[1m'
NC='\033[0m' # No Color
pkgOption=""
echo_error() {
printf "${BOLD}${RED}ERROR: ${NC}${RED}%s${NC}\n" "$1" >&2
}
@ -151,6 +153,11 @@ askThings() {
read -r askFilemgr </dev/tty
fi
if [ ! -d ./dotfiles/.config/tmux/ ] && [ ! -d ./dotfiles/.config/zellij/ ]; then
echo_info "Choose a cli multiplexer - [t]mux || [z]ellij || [n]one"
read -r askMultiPlexer </dev/tty
fi
echo_info "Do you also want to install optional packages? (y/n)"
read -r askOptional </dev/tty
@ -176,9 +183,39 @@ cloneDots() {
__validate__() {
if askThings; then
case "$askFilemgr" in
[yY] | yazi) cloneDots "yazi" ;;
[rR] | ranger) cloneDots "ranger" ;;
[lL] | lf) cloneDots "lf" ;;
[yY] | yazi)
cloneDots "yazi"
if command_exists curl; then
curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/yazi.sh | bash
else
echo_warning "curl was not found, could not install yazi!"
fi
;;
[rR] | ranger)
cloneDots "ranger"
pkgOption="${pkgOption:ranger}"
;;
[lL] | lf)
cloneDots "lf"
pkgOption="${pkgOption:lf}"
;;
esac
case "$askMultiPlexer" in
[tT] | tmux)
cloneDots "tmux"
pkgOption="${pkgOption:tmux}"
;;
[zZ] | zellij)
cloneDots "zellij"
if ! command_exists zellij; then
if command_exists curl; then
curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/zellij.sh | bash
else
echo_warning "curl was not found, could not install zellij!"
fi
fi
;;
esac
else
echo_error "Something went terribly wrong"
@ -237,9 +274,6 @@ pkg_optional() {
fi
done
if ! command_exists zellij; then
curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/zellij.sh | bash
fi
;;
*)
echo default
@ -281,8 +315,9 @@ main() {
sleep 2
[ "$__optional__" == 'true' ] &&
if $__optional__; then
pkg_optional
fi
# __monitors__
# echo_note "found resolution ${res}"