-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Wifi segment #1262
Wifi segment #1262
Conversation
if !w.env.hasCommand(cmd) { | ||
return false | ||
} | ||
cmdResult, err := w.env.runCommand(cmd, "wlan", "show", "interfaces") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't work cross platform so if you want to contribute this, you need to find a way that works everywhere ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't see these comments. I meant to push the PR to my own repo so I could run the GitHub Actions.
I have a new PR that I just submitted. But it will have this same limitation. Testing this feature is impossible without a physical Linux machine with an actual WiFi network interface. Virtual Linux environments don't have that.
What other things could I do? I noticed the spotify segment has some compilation hints that allows them to have Windows, Linux, and WSL specific implementations. I was thinking of doing something like that, and just excluding Linux/Darwin for now.
return false | ||
} | ||
|
||
regex := regexp.MustCompile(`(.+) : (.+)`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also have regex helpers for this (we cache the compilations), see regex.go
for more information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice. I will look into that and update my other PR.
} | ||
|
||
func (w *wifi) string() string { | ||
segmentTemplate := w.props.getString(SegmentTemplate, "{{.SSID}} {{.SignalStrength}} {{.ReceiveRate}}Mbps") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done, that's 👍🏻
Here is the actual PR with a bunch more work on it! Or should we close the other one and re-open this one?? I don't have the ability to Reopen. The button is greyed out. |
Prerequisites
CONTRIBUTING
guideDescription
[Description of the change]