fix: font size is constnat no matter the screne size

This commit is contained in:
Krzysztof Rudnicki 2024-11-18 08:59:36 +01:00
parent f9e3dc72eb
commit a9e1271d95
2 changed files with 8 additions and 5 deletions

View File

@ -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"

View File

@ -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