From 16ffd85d429954225feed105fabab0a5396a20cf Mon Sep 17 00:00:00 2001 From: pika Date: Wed, 21 May 2025 22:32:48 +0200 Subject: [PATCH] testing also the new beautiful script --- rofi.sh | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/rofi.sh b/rofi.sh index c13e04a..7ffb0e9 100644 --- a/rofi.sh +++ b/rofi.sh @@ -19,12 +19,12 @@ # 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.. getImports() { - local url="https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh" + local url="$1" local import="$(mktemp)" if command_exists curl; then curl -fsSL $url -o $import elif command_exists wget; then - wget -o $import $url + wget -O $import $url else echo "curl/wget is required, but missing.." exit 69 @@ -36,7 +36,8 @@ } getDependencies() { - echo_info "Checking build dependencies.." + local err + # echo_info "Checking build dependencies.." # INFO: # ╭─────────────────────────────────────────────────────────────────────────╮ @@ -66,8 +67,13 @@ case "$distro" in debian | ubuntu | arch | fedora | alpine | opensuse) - echo_info "Installing missing dependencies.." - checkAndInstall "${pkgArray[@]}" + # echo_info "Installing missing dependencies.." + spin "Instaling missing dependencies.." + if run -err err checkAndInstall "${pkgArray[@]}"; then + check "Installed dependencies $(pen blue ${pkgArray[@]}) correctly" + else + throw "$err" + fi ;; *) echo_error "Cannot install for $distro" @@ -78,9 +84,15 @@ rofi_clone_and_build() { local rofiTemp="$(mktemp -d)" - echo_pkg clone "Cloning rofi to $rofiTemp/rofi" + local err + # echo_pkg clone "Cloning rofi to $rofiTemp/rofi" + spin yellow "Cloning $(pen red $PACKAGE) into $rofiTemp/$PACKAGE" - git clone --depth=1 https://github.com/A417ya/rofi-wayland "$rofiTemp/rofi" + if run --err err git clone --depth=1 https://github.com/A417ya/rofi-wayland "$rofiTemp/rofi"; then + check green "Cloned $PACKAGE" + else + throw "$out" + fi sleep 0.2 @@ -91,14 +103,21 @@ echo_pkg build - run meson setup build - - run ninja -C build + spin + if run --err err1 meson setup build; then + if run --err err2 ninja -C build; then + check "Build $PACKAGE complete" + else + throw "$err2" + fi + else + throw "$err1" + fi echo_pkg install ninja -C build install - echo_note "Cleaning up old $rofiTemp directory.." + pen grey "Cleaning up old $rofiTemp directory.." rm -rf $rofiTemp } @@ -119,7 +138,7 @@ esac } - if getImports; then + if getImports "https://git.k4li.de/scripts/beddu/raw/branch/main/dist/beddu.sh" && getImports "https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh"; then # ─< package variable >─────────────────────────────────────────────────────────────────── unset PACKAGE