Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nextwork): airport response is multi-line if wifi disabled #332

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

jakereps
Copy link
Contributor

If WiFi is fully disabled (toggled off on macOS), the response from the networksetup call, while determining if you're on an airport network, fails to be correctly compared due to an additional line of text added.

› networksetup -getairportnetwork en0 | cut -d ':' -f 2
You are not associated with an AirPort network.
Wi-Fi power is currently off.

This results in the network widget displaying the long string "Wi-Fi power is currently off."

This change simply sets it to always grab the first line instead.

› networksetup -getairportnetwork en0 | cut -d ':' -f 2 | head -n 1
You are not associated with an AirPort network.

Which resulted in the correct display of showing my laptop was on Ethernet.

@ethancedwards8
Copy link
Member

Good catch. Thanks.

@ethancedwards8 ethancedwards8 merged commit c3b5d2a into dracula:master Mar 12, 2025
1 check passed
@jakereps jakereps deleted the patch-1 branch March 20, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants