adapting to the new installation style
This commit is contained in:
parent
062371f038
commit
5c74497d14
1 changed files with 34 additions and 29 deletions
63
rofi.sh
63
rofi.sh
|
@ -18,27 +18,24 @@
|
||||||
# CAUTION:
|
# CAUTION:
|
||||||
# This only wokrs for generic package names, like neovim, or vim, or tmux etc..
|
# This only wokrs for generic package names, like neovim, or vim, or tmux etc..
|
||||||
# not every package packagemanager has the same packagenames for their packages..
|
# not every package packagemanager has the same packagenames for their packages..
|
||||||
getImports() {
|
source-script() {
|
||||||
local url="$1"
|
i="https://git.k4li.de/scripts/imports/raw/branch/main/dream.sh"
|
||||||
local import="$(mktemp)"
|
import="$(mktemp)"
|
||||||
if command_exists curl; then
|
if command_exists curl; then
|
||||||
curl -fsSL $url -o $import
|
curl -fsSL $i -o $import
|
||||||
elif command_exists wget; then
|
|
||||||
wget -O $import $url
|
|
||||||
else
|
else
|
||||||
echo "curl/wget is required, but missing.."
|
echo "curl is required, but missing.."
|
||||||
exit 69
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source "$import"
|
source "$import"
|
||||||
sleep 0.2
|
sleep 0.3
|
||||||
rm "$import"
|
rm "$import"
|
||||||
echo "imported $url"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getDependencies() {
|
getDependencies() {
|
||||||
local err
|
local err
|
||||||
echo_info "Checking build dependencies.."
|
pen bold blue "Checking build dependencies.."
|
||||||
|
|
||||||
# INFO:
|
# INFO:
|
||||||
# ╭─────────────────────────────────────────────────────────────────────────╮
|
# ╭─────────────────────────────────────────────────────────────────────────╮
|
||||||
|
@ -69,18 +66,15 @@
|
||||||
|
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
debian | ubuntu | arch | fedora | alpine | opensuse)
|
debian | ubuntu | arch | fedora | alpine | opensuse)
|
||||||
# echo_info "Installing missing dependencies.."
|
# pen bold blue "Installing missing dependencies.."
|
||||||
spin "Instaling missing dependencies.."
|
spin bold blue "Instaling missing packages.."
|
||||||
if run -err err checkAndInstall "${pkgArray[@]}"; then
|
if run -err err check-and-install ${pkgArray[@]}; then
|
||||||
check "Installed dependencies $(pen blue ${pkgArray[@]}) correctly"
|
upclear
|
||||||
|
check bold green "Build dependencies installed"
|
||||||
# echo
|
|
||||||
# echo
|
|
||||||
# echo
|
|
||||||
# foo="$?"
|
|
||||||
# echo $foo
|
|
||||||
else
|
else
|
||||||
check "$err"
|
upclear
|
||||||
|
throw bold red "Error installing build dependencies"
|
||||||
|
echo-error "${err:-}"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -91,7 +85,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
rofi_clone_and_build() {
|
rofi_clone_and_build() {
|
||||||
getDependencies
|
|
||||||
local rofiTemp="$(mktemp -d)"
|
local rofiTemp="$(mktemp -d)"
|
||||||
local err
|
local err
|
||||||
# echo_pkg clone "Cloning rofi to $rofiTemp/rofi"
|
# echo_pkg clone "Cloning rofi to $rofiTemp/rofi"
|
||||||
|
@ -134,7 +127,7 @@
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if $silent; then
|
if $silent; then
|
||||||
echo_warning "Executing script silently!"
|
pen bold yellow "Executing script silently!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
getDependencies
|
getDependencies
|
||||||
|
@ -149,16 +142,28 @@
|
||||||
spin blue "Using arch, getting rofi directly.."
|
spin blue "Using arch, getting rofi directly.."
|
||||||
sleep 1
|
sleep 1
|
||||||
if run -err err _install rofi; then
|
if run -err err _install rofi; then
|
||||||
check "Installed rofi"
|
upclear
|
||||||
|
check bold green "Installed rofi"
|
||||||
else
|
else
|
||||||
throw "Could not install rofi!"
|
upclear
|
||||||
|
throw bold red "Could not install rofi!"
|
||||||
echo_error "${err:-}"
|
echo_error "${err:-}"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
if getImports "https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh" && getImports "https://git.k4li.de/scripts/beddu/raw/branch/main/dist/beddu.sh"; then
|
setup-env() {
|
||||||
|
# local beddu=https://git.k4li.de/scripts/beddu/raw/branch/main/dist/beddu.sh
|
||||||
|
# local pika=https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh
|
||||||
|
local dream=https://git.k4li.de/scripts/imports/raw/branch/main/dream.sh
|
||||||
|
|
||||||
|
if ! command_exists pkg-install && ! command_exists check-and-install && ! command_exists spin; then
|
||||||
|
source-script $dream
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if setup-env; then
|
||||||
sleep 3
|
sleep 3
|
||||||
# ─< package variable >───────────────────────────────────────────────────────────────────
|
# ─< package variable >───────────────────────────────────────────────────────────────────
|
||||||
unset PACKAGE
|
unset PACKAGE
|
||||||
|
@ -170,8 +175,8 @@
|
||||||
|
|
||||||
PACKAGE=rofi
|
PACKAGE=rofi
|
||||||
if command_exists "$PACKAGE"; then
|
if command_exists "$PACKAGE"; then
|
||||||
echo_warning "$PACKAGE is already installed!"
|
pen bold yellow "$PACKAGE is already installed!"
|
||||||
echo_warning "Exiting now!"
|
pen bold yellow "Exiting now!"
|
||||||
exit 69
|
exit 69
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue