From f3029a682cb6f1d686b03cc48e43f2629f300c9f Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 26 May 2025 15:53:56 +0200 Subject: [PATCH] adapting for dream use --- swww.sh | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/swww.sh b/swww.sh index 39b2bfa..6a3858c 100644 --- a/swww.sh +++ b/swww.sh @@ -29,7 +29,6 @@ source "$import" echo "${BLUE}Sourcing external script:${NC} $url" - line sleep 0.1 rm -f "$import" fi @@ -41,6 +40,7 @@ # echo "DEBUG: Installing ${deps[@]}" check-and-install ${deps[@]} + pen bold yellow "Checking cargo.." if ! command_exists cargo; then curl --proto '=https' --tlsv1.2 -sSf "https://sh.rustup.rs" | sh else @@ -49,18 +49,32 @@ } cloneAndBuildSwww() { + local err out local cloneDir="$(mktemp -d)" - echo_pkg clone "cloning swww into $cloneDir/swww" - run git clone --depth=1 https://github.com/LGFae/swww.git $cloneDir/swww + spin bold yellow "cloning swww into $cloneDir/swww" + if run --err err --out out git clone --depth=1 https://github.com/LGFae/swww.git $cloneDir/swww; then + upclear + check bold green "Cloned $PACKAGE successfully" + else + upclear + throw bold red "Error cloning $PACKAGE!" + pen bold yellow "OUT: ${out:-}" + echo-error "${err:-}" + fi - cd $cloneDir/swww || echo_error "error.." + cd $cloneDir/swww || echo-error "error.." - echo_pkg build - if run cargo build --release; then - echo_pkg install + spin bold yellow "Building $PACKAGE now" + if run --err err --out out cargo build --release; then + upclear + check bold green "Build $PACKAGE!" + pen bold blue "Installing into bin.." $_sudo cp target/release/swww{,-daemon} /bin/ else - echo_error "Could not build with cargo build --release.." + upclear + throw bold red "Could not build $PACKAGE!" + pen bold yellow "OUT: ${out:-}" + echo-error "${err:-}" fi }