powerlevel10k icon indicating copy to clipboard operation
powerlevel10k copied to clipboard

Add "b" in POWERLEVEL9K_IP_INTERFACE

Open ssergey2018 opened this issue 3 months ago • 6 comments

Hello! Please add the letter "b" to the POWERLEVEL9K_IP_INTERFACE variable. If an interface bridge is used, information output using this bridge variable on the interface does not work.

ssergey2018 avatar Oct 07 '25 09:10 ssergey2018

Do you mean the default value of POWERLEVEL9K_IP_INTERFACE?

What is the output of ip -4 a show on your machine? Which of these interfaces do you want to see?

Note that you can set the value of POWERLEVEL9K_IP_INTERFACE to whatever you like. The default values aren't meant to be a perfect fit for everybody.

romkatv avatar Oct 07 '25 09:10 romkatv

The POWERLEVEL9K_IP_INTERFACE variable is so deeply buried that it's clearly not meant to be easily changed. This isn't critical, just a matter of convenience.

ssergey2018 avatar Oct 07 '25 10:10 ssergey2018

I think you mean to say it's far down the one (admittedly huge) configuration file that exists.

In any case, all the typeset declarations in the p10k.zsh are indeed meant to be tweaked to your liking, you don't have to worry about messing up some internals there!

ccjmne avatar Oct 07 '25 10:10 ccjmne

Thank you, I understand. Perhaps by solving these problems I'll learn to find the necessary parameters faster.

ssergey2018 avatar Oct 07 '25 10:10 ssergey2018

When you need to tweak the behavior or presentation of a prompt segment, search for its name followed by colon in ~/.p10k.zsh. In this case you are interested in ip, so search for " ip: ". You'll see all relevant parameters in there with a bit of documentation.

###########[ ip: ip address and bandwidth usage for a specified network interface ]###########
# IP color.
typeset -g POWERLEVEL9K_IP_FOREGROUND=38
# The following parameters are accessible within the expansion:
#
#   Parameter             | Meaning
#   ----------------------+-------------------------------------------
#   P9K_IP_IP             | IP address
#   P9K_IP_INTERFACE      | network interface
#   P9K_IP_RX_BYTES       | total number of bytes received
#   P9K_IP_TX_BYTES       | total number of bytes sent
#   P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt
#   P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt
#   P9K_IP_RX_RATE        | receive rate (since last prompt)
#   P9K_IP_TX_RATE        | send rate (since last prompt)
typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F⇡$P9K_IP_TX_RATE}'
# Show information for the first network interface whose name matches this regular expression.
# Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*'
# Custom icon.
# typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'

romkatv avatar Oct 07 '25 10:10 romkatv

@romkatv you're a true hero for still taking time to reply to people here despite having stopped maintaining it for almost 2 years now.

I hope this thing keeps working forever, I love it so damn much.

voltuer avatar Oct 20 '25 03:10 voltuer