wip
This commit is contained in:
parent
85be06d7a3
commit
259b2cd66a
1 changed files with 34 additions and 77 deletions
111
test.sh
111
test.sh
|
@ -6,16 +6,6 @@
|
||||||
command -v "$@" >/dev/null 2>&1
|
command -v "$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# run() {
|
|
||||||
# if $silent; then
|
|
||||||
# # silentexec "$@" &
|
|
||||||
# spin "Installing packages" &
|
|
||||||
# silentexec "$@"
|
|
||||||
# else
|
|
||||||
# "$@"
|
|
||||||
# fi
|
|
||||||
# }
|
|
||||||
|
|
||||||
# WHY:
|
# WHY:
|
||||||
# This import will give you the following variables:
|
# This import will give you the following variables:
|
||||||
# _sudo="sudo -E" <- only if non root user
|
# _sudo="sudo -E" <- only if non root user
|
||||||
|
@ -50,95 +40,62 @@
|
||||||
choose multiplexer "Select a multiplexer" tmux zellij </dev/tty
|
choose multiplexer "Select a multiplexer" tmux zellij </dev/tty
|
||||||
choose menu "Select a menu package" rofi wofi tofi </dev/tty
|
choose menu "Select a menu package" rofi wofi tofi </dev/tty
|
||||||
choose shell "Select a shell" zsh bash fish nushell </dev/tty
|
choose shell "Select a shell" zsh bash fish nushell </dev/tty
|
||||||
|
|
||||||
|
stuff=(
|
||||||
|
$multiplexer
|
||||||
|
$menu
|
||||||
|
$shell
|
||||||
|
$package
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
install-stuff() {
|
install-stuff() {
|
||||||
|
ask-stuff
|
||||||
|
local err
|
||||||
|
|
||||||
arr=(
|
arr=(
|
||||||
firefox-bin
|
nautilus
|
||||||
blender-bin
|
firefox-esr
|
||||||
$package
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# case "$distro" in
|
check-and-install ${arr[@]} ${stuff[@]}
|
||||||
# arch)
|
|
||||||
# $_sudo pacman -Syu
|
|
||||||
# ;;
|
|
||||||
# esac
|
|
||||||
|
|
||||||
check-and-install ${arr[@]}
|
if confirm "Do you want to remove the previous installed (doesn't inclued the stuff you put in yourself) packages?"; then
|
||||||
|
line
|
||||||
if confirm "Do you want to remove the previous installed packages?"; then
|
pen grey bold "Packages to remove: $(pen bold red ${#arr[@]})"
|
||||||
for pkg in "${arr[@]}"; do
|
for pkg in "${arr[@]}"; do
|
||||||
pkg-remove $pkg
|
spin "Removing $pkg"
|
||||||
|
if run --err err pkg-remove $pkg; then
|
||||||
|
upclear
|
||||||
|
check "Removed $pkg"
|
||||||
|
else
|
||||||
|
upclear
|
||||||
|
throw "Error removing $pkg"
|
||||||
|
echo-error "${err:-}"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
func1() {
|
|
||||||
spin yellow "installing stuff"
|
|
||||||
# if run install-stuff; then
|
|
||||||
if run --err err --out out git clone --depth=1 https://github.com/neovim/neovim.git; then
|
|
||||||
check "Installation complete"
|
|
||||||
line
|
|
||||||
pen "${out:-}"
|
|
||||||
else
|
|
||||||
throw "Installation failed!"
|
|
||||||
pen "${err:-}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
func2() {
|
|
||||||
# run --err install-stuff
|
|
||||||
if [ -d ./neovim ]; then
|
|
||||||
if confirm "$(pen bold blue 'Do you want to remove the cloned ./neovim directory?')" </dev/tty; then
|
|
||||||
rm -rf ./neovim/
|
|
||||||
else
|
|
||||||
pen red bold "Did not remove the neovim directory!"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
func3() {
|
|
||||||
local err
|
|
||||||
arr=(
|
|
||||||
firefox-esr
|
|
||||||
)
|
|
||||||
|
|
||||||
if $arch; then
|
|
||||||
spin blue "Installing.."
|
|
||||||
if run --err err checkAndInstall "${arr[@]}"; then
|
|
||||||
check "Installed $(pen red ${arr[*]})"
|
|
||||||
else
|
|
||||||
throw "Something went wrong installing ${arr[*]}.."
|
|
||||||
throw "${err:-}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
# if $silent; then
|
|
||||||
# echo_warning "Executing script silently!"
|
|
||||||
# fi
|
|
||||||
# func1
|
|
||||||
# func2
|
|
||||||
# func3
|
|
||||||
# if ask-stuff; then
|
|
||||||
seek package "What packages should also get installed? space separated list.." </dev/tty
|
seek package "What packages should also get installed? space separated list.." </dev/tty
|
||||||
if confirm "Do you want to 'install-stuff'?" </dev/tty; then
|
if confirm "Do you want to 'install-stuff'?" </dev/tty; then
|
||||||
|
line
|
||||||
install-stuff
|
install-stuff
|
||||||
fi
|
fi
|
||||||
# fi
|
# for i in {3..6}; do
|
||||||
|
# spin grey "Testing $i seconds.."
|
||||||
# while install-stuff && break; do
|
# if sleep $i; then
|
||||||
# spin "Installing packages.."
|
# upclear
|
||||||
|
# check green bold "Successfully waited $i seconds!"
|
||||||
|
# # line
|
||||||
|
# fi
|
||||||
# done
|
# done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dream="https://git.k4li.de/scripts/imports/raw/branch/main/dream.sh"
|
dream="https://git.k4li.de/scripts/imports/raw/branch/main/dream.sh"
|
||||||
if getImports "$dream"; then
|
if getImports "$dream"; then
|
||||||
|
|
||||||
main
|
main
|
||||||
fi
|
fi
|
||||||
# fi
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue