From a9e1271d951d6f963dfe2e4c6d36825c965943b2 Mon Sep 17 00:00:00 2001 From: Krzysztof Rudnicki Date: Mon, 18 Nov 2024 08:59:36 +0100 Subject: [PATCH] fix: font size is constnat no matter the screne size --- i3blocks/network_monitor.sh | 8 ++++---- install.sh | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/i3blocks/network_monitor.sh b/i3blocks/network_monitor.sh index c03a5a2..8987549 100755 --- a/i3blocks/network_monitor.sh +++ b/i3blocks/network_monitor.sh @@ -71,9 +71,9 @@ else fi # Convert speeds to human-readable format -rx_rate_human=$(numfmt --to=iec --suffix=B/s $total_rx_rate) -tx_rate_human=$(numfmt --to=iec --suffix=B/s $total_tx_rate) +rx_rate_human=$(numfmt --to=iec --suffix=B/s --padding=8 $total_rx_rate) +tx_rate_human=$(numfmt --to=iec --suffix=B/s --padding=8 $total_tx_rate) -# Output the result with fixed width -printf " %-8s  %-8s\n" "$rx_rate_human" "$tx_rate_human" +# Store the result of printf into a string and echo it +printf " %s  %s\n" "$rx_rate_human" "$tx_rate_human" echo "#50FA7B" \ No newline at end of file diff --git a/install.sh b/install.sh index b8a7c00..749249d 100755 --- a/install.sh +++ b/install.sh @@ -9,8 +9,11 @@ is_ubuntu() { set_font_size() { resolution=$(xdpyinfo | grep dimensions | awk '{print $2}') width=$(echo $resolution | cut -d 'x' -f 1) + # Do not change this font size, it actually makes i3blocks unbearable to look at: + # Icons (like for slack) are too small and i3blocks are too big + # Network monitor jumping becomes annoying if [ "$width" -gt 1920 ]; then - echo "14" + echo "8" else echo "8" fi