Skip to content

Commit 43997c4

Browse files
Merge pull request #263 from m99coder/patch-1
Use fixed width for network bandwidth to avoid jumps
2 parents 8f1a959 + 2dcc567 commit 43997c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/network_bandwidth.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ main() {
112112
IFS=" " read -ra bandwidth <<<"$(get_bandwidth "$network_name")"
113113

114114
if [[ $show_interface == "true" ]]; then echo -n "[$network_name] "; fi
115-
echo "$(bandwidth_to_unit "${bandwidth[$DOWNLOAD]}") • ↑ $(bandwidth_to_unit "${bandwidth[$UPLOAD]}")"
115+
printf "%6s %-4s • ↑ %6s %-4s\n" $(bandwidth_to_unit "${bandwidth[$DOWNLOAD]}") $(bandwidth_to_unit "${bandwidth[$UPLOAD]}")
116116

117117
((counter = counter - 1))
118118
sleep "$interval_update"

0 commit comments

Comments
 (0)