This commit is contained in:
pika 2025-06-02 14:21:37 +02:00
parent 57fa5e6344
commit 38d53602ec

126
test.sh
View file

@ -49,15 +49,70 @@
) )
} }
install-stuff() { ask-stuff-old() {
ask-stuff pen bold blue "What multiplexer do you prefer (tmux/zellij)?"
local err read -r multiplexer </dev/tty
pen bold blue "What menu do you prefer (rofi/tofi/wofi/fuzzel)?"
read -r menu </dev/tty
pen bold blue "What shell do you prefer (zsh/bash/fish)?"
read -r shell </dev/tty
pen bold blue "What packages should also get installed? (space separated list)"
read -r package </dev/tty
case "$multiplexer" in
t | tmux)
multiplexer=tmux
;;
z | zellij)
multiplexer=zellij
;;
esac
case "$menu" in
r | rofi)
menu=rofi
;;
t | tofi)
menu=tofi
;;
w | wofi)
menu=wofi
;;
f | fuzzel)
menu=fuzzel
;;
esac
case "$shell" in
z | zsh)
shell=zsh
;;
b | bash)
shell=bash
;;
f | fish)
shell=fish
;;
esac
stuff=(
$multiplexer
$menu
$shell
$package
)
}
arr=( arr=(
nautilus nautilus
firefox-esr firefox
neofetch
) )
install-stuff() {
local err
check-and-install ${arr[@]} ${stuff[@]} check-and-install ${arr[@]} ${stuff[@]}
if confirm "Do you want to remove the previous installed (doesn't inclued the stuff you put in yourself) packages?"; then if confirm "Do you want to remove the previous installed (doesn't inclued the stuff you put in yourself) packages?"; then
@ -77,12 +132,67 @@
fi fi
} }
main() { new() {
seek package "What packages should also get installed? space separated list.." </dev/tty pen bold blue "This is the new version"
if confirm "Do you want to 'install-stuff'?" </dev/tty; then
line ask-stuff
install-stuff install-stuff
}
old() {
ask-stuff-old
pen bold red "This is the old version"
for pkg in "${arr[@]} ${stuff[@]}"; do
if ! command-exists $pkg; then
pen bold blue "Installing $pkg"
pkg-install $pkg
else
pen bold yellow "$pkg is already installed"
fi fi
done
pen bold red "Done installing, now removing again.."
for pkg in "${arr[@]}"; do
if command-exists $pkg; then
pen bold blue "Removing $pkg"
pkg-remove $pkg
else
pen bold yellow "$pkg is not present"
fi
done
}
main() {
choose version "What version do you want to vew?" old new </dev/tty
case "$version" in
old) old ;;
new) new ;;
esac
line
pen bold red "This was the $version version"
line
if confirm "Do you want to rerun the script?" </dev/tty; then
line
echo "----------------------------------------"
echo "----------------------------------------"
line
main
fi
# seek package "What packages should also get installed? space separated list.." </dev/tty
# if confirm "Do you want to 'install-stuff'?" </dev/tty; then
# line
# install-stuff
# fi
# for i in {3..6}; do # for i in {3..6}; do
# spin grey "Testing $i seconds.." # spin grey "Testing $i seconds.."
# if sleep $i; then # if sleep $i; then