Skip to content
New issue

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

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

Already on GitHub? # to your account

Update network.sh to not cut off SSIDs starting with ^ #237

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

djfpaagman
Copy link
Contributor

@djfpaagman djfpaagman commented Oct 16, 2023

My SSID is ^_^. I noticed that gets cutt of to _^ in the status bar.

I think the original regex (introduced here: #39) is just wrong, maybe the "start of line" indicator is in the wrong place? Anyway, this new regex will fix that.

The plain SSID without the regex replacement:

❯ echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)"
 ^_^

(note the extra space it's supposed to remove)

Before:

❯ echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)" | sed 's/ ^*//g'
_^

After:

❯ echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)" | sed 's/^[[:blank:]]*//g'
^_^

sed 's/^ *//g' will also work, but I like the explicitness of [[:blank:]].

@ethancedwards8
Copy link
Member

Heh that's amusing, thanks for the fix.

@ethancedwards8 ethancedwards8 merged commit 77bad73 into dracula:master Oct 17, 2023
1 check passed
@djfpaagman djfpaagman deleted the patch-1 branch December 4, 2023 10:57
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants