Actualiser .i3blocks/batterybar
This commit is contained in:
parent
aec05c139d
commit
527d0f17bb
1 changed files with 6 additions and 37 deletions
|
@ -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} ))
|
||||
|
|
Loading…
Reference in a new issue