mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 12:20:07 +00:00
slightly shorter bandwidth display
This commit is contained in:
parent
01cce2c4eb
commit
75e5712cd0
1 changed files with 5 additions and 5 deletions
|
@ -4597,7 +4597,7 @@ function _p9k_prompt_net_iface_async() {
|
||||||
fi
|
fi
|
||||||
if _p9k_prompt_net_iface_match $_POWERLEVEL9K_IP_INTERFACE; then
|
if _p9k_prompt_net_iface_match $_POWERLEVEL9K_IP_INTERFACE; then
|
||||||
local ip_ip=$ip ip_interface=$iface ip_timestamp=$EPOCHREALTIME
|
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 [[ $_p9k_os == (Linux|Android) ]]; then
|
||||||
if [[ -r /sys/class/net/$iface/statistics/rx_bytes ]] &&
|
if [[ -r /sys/class/net/$iface/statistics/rx_bytes ]] &&
|
||||||
_p9k_read_file /sys/class/net/$iface/statistics/rx_bytes; then
|
_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_tx_rate=$P9K_IP_TX_RATE
|
||||||
ip_rx_rate=$P9K_IP_RX_RATE
|
ip_rx_rate=$P9K_IP_RX_RATE
|
||||||
else
|
else
|
||||||
_p9k_human_readable_bytes $((8 * (ip_tx_bytes - P9K_IP_TX_BYTES) / t))
|
_p9k_human_readable_bytes $(((ip_tx_bytes - P9K_IP_TX_BYTES) / t))
|
||||||
ip_tx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]bps"
|
[[ $_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 $((8 * (ip_rx_bytes - P9K_IP_RX_BYTES) / t))
|
_p9k_human_readable_bytes $(((ip_rx_bytes - P9K_IP_RX_BYTES) / t))
|
||||||
ip_rx_rate="$_p9k_ret[1,-2] $_p9k_ret[-1]bps"
|
[[ $_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
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue