From 527d0f17bbab1804e56d4b25dbb133cf0326b427 Mon Sep 17 00:00:00 2001 From: Breizh Date: Mon, 11 Mar 2024 12:36:54 +0100 Subject: [PATCH] Actualiser .i3blocks/batterybar --- .i3blocks/batterybar | 43 ++++++------------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/.i3blocks/batterybar b/.i3blocks/batterybar index e634cf0..5099f02 100755 --- a/.i3blocks/batterybar +++ b/.i3blocks/batterybar @@ -82,49 +82,18 @@ percents=$(( percentage / 2 )) ## à partir des données brutes # percents=$(( (POWER_SUPPLY_CHARGE_NOW - MIN) * 48 / (MAX - MIN) )) +# Définition des symboles +chars=("█" "░" "░" "▒" "▒" "▓" "▓" "█") +#chars=("█" "▏" "▎" "▍" "▌" "▋" "▊" "▉") +#chars=("█" "▁" "▂" "▃" "▄" "▅" "▆" "▇") full_squares=$(( percents / 8 )) for t in $(seq 1 $full_squares) do - squares+="█" + squares+="${chars[0]}" done -if [[ $(( percents - ( full_squares * 8 ) )) -eq 7 ]] -then - #squares+="█" - squares+="▉" - #squares+="▇" -elif [[ $(( percents - ( full_squares * 8 ) )) -eq 6 ]] -then - #squares+="▓" - squares+="▊" - #squares+="▆" -elif [[ $(( percents - ( full_squares * 8 ) )) -eq 5 ]] -then - #squares+="▓" - squares+="▋" - #squares+="▅" -elif [[ $(( percents - ( full_squares * 8 ) )) -eq 4 ]] -then - #squares+="▒" - squares+="▌" - #squares+="▄" -elif [[ $(( percents - ( full_squares * 8 ) )) -eq 3 ]] -then - #squares+="▒" - squares+="▍" - #squares+="▃" -elif [[ $(( percents - ( full_squares * 8 ) )) -eq 2 ]] -then - #squares+="░" - squares+="▎" - #squares+="▂" -elif [[ $(( percents - ( full_squares * 8 ) )) -eq 1 ]] -then - #squares+="░" - squares+="▏" - #squares+="▁" -fi +squares+="${chars[$(( percents - ( full_squares * 8 ) ))]}" # Complétion de la barre afin d'avoir une taille fixe blanks=$(( 6 - ${#squares} ))