powerlevel10k icon indicating copy to clipboard operation
powerlevel10k copied to clipboard

Wi-fi speed icon not showing up after updating to Sonoma 14.4

Open Antho1641 opened this issue 1 year ago • 11 comments

I've checked the p10.zsh file and it's still enabled, it was showing up this morning before I updated from Ventura but now it doesn't. is there a way I can fix this? or is there some other possible issue?

Antho1641 avatar Mar 08 '24 12:03 Antho1641

Let me upgrade my mac and see if I can reproduce this.

romkatv avatar Mar 08 '24 19:03 romkatv

I too am having this same issue as of macOS 14.4. Confirm that this worked as-expected in 14.3.1.

If it helps, from my .p10k.zsh file...

typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
  # =========================[ Line #1 ]=========================
  os_icon
  ssh
  dir
  vcs
  # =========================[ Line #2 ]=========================
  newline
  prompt_char
)

typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
  # =========================[ Line #1 ]=========================
  status
  command_execution_time
  background_jobs
  virtualenv
  context
  vim_shell
  vpn_ip
  time
  # =========================[ Line #2 ]=========================
  newline
  battery
  wifi
)

jcostom avatar Mar 08 '24 19:03 jcostom

Powerlevel10k uses airport to retrieve the state of the wi-fi on macOS: https://github.com/romkatv/powerlevel10k/blob/0cc19ac2ede35fd8accff590fa71df580dc7e109/internal/p10k.zsh#L5334-L5347

airport no longer works: it's just a stub that points to another tool -- wdutil -- as a replacement. Unfortunately, wdutil requires sudo, so powerlevel10k cannot call it.

If anyone knows a way to retrieve wi-fi info on macOS without superuser privileges, please share.

romkatv avatar Mar 08 '24 19:03 romkatv

Thanks for your speedy response, despite the inconvenience from the update I've been loving the p10k theme and I appreciate the work you've put into it.

Antho1641 avatar Mar 08 '24 22:03 Antho1641

networkQuality doesn't require root, but isn't quite the same thing nor very consistent.

networkQuality -du  
==== SUMMARY ====
Idle Latency: 30.500 milliseconds | 2000 RPM
 🕕 17:52:20  networkQuality -du
==== SUMMARY ====
Idle Latency: 37.375 milliseconds | 1621 RPM

rwmitchell avatar Mar 08 '24 22:03 rwmitchell

If anyone knows a way to retrieve wi-fi info on macOS without superuser privileges, please share.

system_profiler SPAirPortDataType works without sudo.

viking1304 avatar Jun 23 '24 15:06 viking1304

networksetup -getairportnetwork en0 has a much faster response than system_profiler, but it only provide the ssid name.

chengdejerrylin avatar Jun 23 '24 18:06 chengdejerrylin

@romkatv any updates for mac?... the ip shows the speed! both upload and download.... may be some internal issue for wifi function...

vandit2209 avatar Sep 27 '24 13:09 vandit2209

I don't have any updates here. I don't intend to work on this issue.

romkatv avatar Sep 27 '24 16:09 romkatv

I did manage to do something similar, but it takes forever to use as a prompt, so I will work on making it async later. I am accepting suggestions as well, as you can see, I simply changed the sample custom prompt:

  function prompt_example() {
    wifi_info=$(system_profiler SPAirPortDataType | sed -n '/Current Network Information:/,/Other Local Wi-Fi Networks:/p')
    wifi_info=$(echo "$wifi_info" | sed '1d;$d')
    phy_mode=$(echo "$wifi_info" | grep -i "PHY Mode" | awk -F ": " '{print $2}')
    channel=$(echo "$wifi_info" | grep -i "Channel" | awk -F ": " '{print $2}')
    signal_noise=$(echo "$wifi_info" | grep -i "Signal / Noise" | awk -F ": " '{print $2}')
    transmit_rate=$(echo "$wifi_info" | grep -i "Transmit Rate" | awk -F ": " '{print $2}')
    example="$phy_mode $channel SNR: $signal_noise Speed: $transmit_rate Mbps"

    p10k segment -b 1 -f 3 -i '🛜' -t $example
    # In mine it shows as "802.11ax 100 (5GHz, 160MHz) SNR: -59 dBm / -91 dBm Speed: 576 Mbps 🛜"
  }

carloslimaborges avatar Jan 14 '25 03:01 carloslimaborges

networksetup -getairportnetwork en0 has a much faster response than system_profiler, but it only provide the ssid name.

this one didn't work for me, but networksetup -getinfo Wi-Fi did. No Signal, Noise, nor Speed, as you already mentioned.

carloslimaborges avatar Jan 14 '25 03:01 carloslimaborges