install.sh: refactoring

This commit is contained in:
krolxon 2026-01-09 14:44:08 +05:30
parent cdd7d036c7
commit 334eaefdeb
3 changed files with 15 additions and 11 deletions

View File

@ -1,7 +1,7 @@
include=~/.cache/wal/colors-foot.ini include=~/.cache/wal/colors-foot.ini
[main] [main]
font=JetBrains Mono Nerd Font:size=12 font=JetBrains Mono Nerd Font:size=11
# pad=15x15 # pad=15x15
[colors] [colors]

View File

@ -5,6 +5,9 @@ trap 'log WARN "Interrupted by user"; exit 130' INT
INSTALL_STATUS="none" # none | partial | complete | failed INSTALL_STATUS="none" # none | partial | complete | failed
AUTO_YES=0 AUTO_YES=0
#######################
## Arguement Parsing ##
#######################
for arg in "$@"; do for arg in "$@"; do
case "$arg" in case "$arg" in
--yes|--ci|--non-interactive) --yes|--ci|--non-interactive)
@ -46,14 +49,6 @@ check_install() {
fi fi
} }
## Add checks for prerequisites
check_install git
check_install gum
check_install stow
currentDir="$(dirname "$(readlink -f "$0")")"
cd "$currentDir"
choose_packages() { choose_packages() {
local -n arr=$1 local -n arr=$1
@ -96,6 +91,15 @@ confirm() {
## GATEKEEPING ## ## GATEKEEPING ##
################# #################
## Add checks for prerequisites
check_install git
check_install gum
check_install stow
currentDir="$(dirname "$(readlink -f "$0")")"
cd "$currentDir"
DISCLAIMER=$(gum style \ DISCLAIMER=$(gum style \
--border double \ --border double \
--border-foreground 196 \ --border-foreground 196 \
@ -230,7 +234,7 @@ Proceed with system configuration (stow, shell)?"; then
log INFO "Running stow..." log INFO "Running stow..."
stow . --no-folding \ stow . --no-folding \
&& log INFO "Dotfiles stowed with overwrite." \ && log INFO "Dotfiles stowed with overwrite." \
|| log ERROR "Stow failed" || log ERROR "Stow failed"
fi fi
@ -246,7 +250,7 @@ Proceed with system configuration (stow, shell)?"; then
log INFO "Skipping: zsh is already the default shell" log INFO "Skipping: zsh is already the default shell"
fi fi
else else
log WARN "Aborted configuration, didn't configure anything" log ERROR "Aborted stow, didn't configure or install anything"
exit 1 exit 1
fi fi

0
packages/pkg_gpu.sh Normal file → Executable file
View File