Skip to content

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