From 75e5712cd036feb13307abdcbca71f634bed1ecd Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 5 Feb 2020 17:26:16 +0100 Subject: [PATCH] slightly shorter bandwidth display --- internal/p10k.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7fe3f237..d44417b2 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4597,7 +4597,7 @@ function _p9k_prompt_net_iface_async() { fi if _p9k_prompt_net_iface_match $_POWERLEVEL9K_IP_INTERFACE; then local ip_ip=$ip ip_interface=$iface ip_timestamp=$EPOCHREALTIME - local ip_tx_bytes=0 ip_rx_bytes=0 ip_tx_rate='0 Bps' ip_rx_rate='0 Bps' + local ip_tx_bytes=0 ip_rx_bytes=0 ip_tx_rate='0 B/s' ip_rx_rate='0 B/s' if [[ $_p9k_os == (Linux|Android) ]]; then if [[ -r /sys/class/net/$iface/statistics/rx_bytes ]] && _p9k_read_file /sys/class/net/$iface/statistics/rx_bytes; then @@ -4625,10 +4625,10 @@ function _p9k_prompt_net_iface_async() { ip_tx_rate=$P9K_IP_TX_RATE ip_rx_rate=$P9K_IP_RX_RATE else - _p9k_human_readable_bytes $((8 * (ip_tx_bytes - P9K_IP_TX_BYTES) / t)) - ip_tx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]bps" - _p9k_human_readable_bytes $((8 * (ip_rx_bytes - P9K_IP_RX_BYTES) / t)) - ip_rx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]bps" + _p9k_human_readable_bytes $(((ip_tx_bytes - P9K_IP_TX_BYTES) / t)) + [[ $_p9k_ret == *B ]] && ip_tx_rate="$_p9k_ret[1,-2] B/s" || ip_tx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]iB/s" + _p9k_human_readable_bytes $(((ip_rx_bytes - P9K_IP_RX_BYTES) / t)) + [[ $_p9k_ret == *B ]] && ip_rx_rate="$_p9k_ret[1,-2] B/s" || ip_rx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]iB/s" fi fi else