From 98408c18bf9a1c38d086683513ebf1f4b58916c7 Mon Sep 17 00:00:00 2001 From: urban Date: Fri, 1 Sep 2023 01:31:04 +0200 Subject: [PATCH] add delay to create artistic effect --- Scripts/create_configuration.sh | 6 +++--- Scripts/utils.sh | 23 +++++++++++++++++++++-- install.sh | 23 +++++++++++++++++++++-- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/Scripts/create_configuration.sh b/Scripts/create_configuration.sh index 01c199f..60058f2 100755 --- a/Scripts/create_configuration.sh +++ b/Scripts/create_configuration.sh @@ -5,9 +5,9 @@ source ./utils.sh new_configuration(){ msg logo.txt - p "We will create a new configuration" + p "We will create a new configuration." + user_pause msg wallet_suggestions.txt - echo "" r "Your bitcoin address:" address #python3 ../Tools/address_validation.py $address echo "" @@ -25,7 +25,7 @@ new_configuration(){ echo "address: $address" > ../Worker/worker.conf echo "pool: $mining_pool" >> ../Worker/worker.conf p "Ready to boil the oceans captain!" - p_ok "To start mining, use the command 'shuriken start'" + p "To start mining, use the command 'shuriken start'" echo "" } diff --git a/Scripts/utils.sh b/Scripts/utils.sh index da33b08..5751014 100644 --- a/Scripts/utils.sh +++ b/Scripts/utils.sh @@ -8,32 +8,46 @@ r(){ p() { echo -e " » $1" + sleep 0.1 } p_user() { - echo -e " › $1" + echo -e " \e[35m› $1\033[0m" + sleep 0.1 } p_err(){ echo -e " \033[31m»\033[0m $1" + sleep 0.1 } p_fatal(){ echo -e " \033[31m» $1\033[0m" + sleep 0.1 } p_ok(){ echo -e " \033[32m»\033[0m $1" + sleep 0.1 } p_warn(){ echo -e " \033[33m!\033[0m $1" + sleep 0.1 } msg() { echo "" - echo -e "$(cat ../Messages/$1)" + sleep 0.1 + while IFS= read -r line + do + echo -e "$line" + sleep 0.1 + done < "../Messages/$1" + echo "$line" + sleep 0.1 echo "" + sleep 0.1 } ask_yes_or_no(){ @@ -47,6 +61,11 @@ ask_yes_or_no(){ return 1 } +user_pause(){ + result=$(gum choose --cursor=  ›  Continue) + p_user "Continue" +} + spin_it(){ local msg=$1 shift diff --git a/install.sh b/install.sh index 160085a..7d743b1 100755 --- a/install.sh +++ b/install.sh @@ -41,32 +41,46 @@ r(){ p() { echo -e " » $1" + sleep 0.1 } p_user() { - echo -e " › $1" + echo -e " \e[35m› $1\033[0m" + sleep 0.1 } p_err(){ echo -e " \033[31m»\033[0m $1" + sleep 0.1 } p_fatal(){ echo -e " \033[31m» $1\033[0m" + sleep 0.1 } p_ok(){ echo -e " \033[32m»\033[0m $1" + sleep 0.1 } p_warn(){ echo -e " \033[33m!\033[0m $1" + sleep 0.1 } msg() { echo "" - echo -e "$(cat ../Messages/$1)" + sleep 0.1 + while IFS= read -r line + do + echo -e "$line" + sleep 0.1 + done < "../Messages/$1" + echo "$line" + sleep 0.1 echo "" + sleep 0.1 } ask_yes_or_no(){ @@ -80,6 +94,11 @@ ask_yes_or_no(){ return 1 } +user_pause(){ + result=$(gum choose --cursor=  ›  Continue) + p_user "Continue" +} + spin_it(){ local msg=$1 shift