refactor: cleanup scripts

This commit is contained in:
Abhishek Keshri 2024-03-17 04:00:27 +05:30 committed by Abhishek Keshri
parent 15b06d5196
commit d2e517d76a
9 changed files with 60 additions and 160 deletions

View file

@ -11,10 +11,8 @@ get_tmux_option() {
fi
}
# normalize the percentage string to always have a length of 5
normalize_percent_len() {
# the max length that the percent can reach, which happens for a two digit number with a decimal house: "99.9%"
max_len=5
normalize_padding() {
max_len=${2:-5}
percent_len=${#1}
let diff_len=$max_len-$percent_len
# if the diff_len is even, left will have 1 more space than right