wip
This commit is contained in:
parent
57fa5e6344
commit
38d53602ec
1 changed files with 119 additions and 9 deletions
128
test.sh
128
test.sh
|
@ -49,14 +49,69 @@
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
install-stuff() {
|
ask-stuff-old() {
|
||||||
ask-stuff
|
pen bold blue "What multiplexer do you prefer (tmux/zellij)?"
|
||||||
local err
|
read -r multiplexer </dev/tty
|
||||||
|
|
||||||
arr=(
|
pen bold blue "What menu do you prefer (rofi/tofi/wofi/fuzzel)?"
|
||||||
nautilus
|
read -r menu </dev/tty
|
||||||
firefox-esr
|
|
||||||
|
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=(
|
||||||
|
nautilus
|
||||||
|
firefox
|
||||||
|
neofetch
|
||||||
|
)
|
||||||
|
|
||||||
|
install-stuff() {
|
||||||
|
local err
|
||||||
|
|
||||||
check-and-install ${arr[@]} ${stuff[@]}
|
check-and-install ${arr[@]} ${stuff[@]}
|
||||||
|
|
||||||
|
@ -77,12 +132,67 @@
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new() {
|
||||||
|
pen bold blue "This is the new version"
|
||||||
|
|
||||||
|
ask-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
|
||||||
|
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() {
|
main() {
|
||||||
seek package "What packages should also get installed? space separated list.." </dev/tty
|
choose version "What version do you want to vew?" old new </dev/tty
|
||||||
if confirm "Do you want to 'install-stuff'?" </dev/tty; then
|
|
||||||
|
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
|
line
|
||||||
install-stuff
|
echo "----------------------------------------"
|
||||||
|
echo "----------------------------------------"
|
||||||
|
line
|
||||||
|
main
|
||||||
fi
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue