From 02d518db5c9569c44401433112baf1be57921dbb Mon Sep 17 00:00:00 2001 From: Woodward Date: Mon, 30 Jul 2018 16:27:40 -0500 Subject: [PATCH 1/8] Adding English Windows support to the wifi module. --- security/wifi.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/security/wifi.go b/security/wifi.go index 30b75767..d05718f9 100644 --- a/security/wifi.go +++ b/security/wifi.go @@ -3,6 +3,7 @@ package security import ( "os/exec" "runtime" + "strings" "github.com/senorprogrammer/wtf/wtf" ) @@ -19,6 +20,8 @@ func WifiEncryption() string { return wifiEncryptionLinux() case "darwin": return wifiEncryptionMacOS() + case "windows": + return wifiEncryptionWindows() default: return "" } @@ -30,6 +33,8 @@ func WifiName() string { return wifiNameLinux() case "darwin": return wifiNameMacOS() + case "windows": + return wifiNameWindows() default: return "" } @@ -82,3 +87,36 @@ func matchStr(data [][]string) string { return data[1][1] } } + +//Windows +func wifiEncryptionWindows() string { + return parseWlanNetsh("Authentication") +} + +func wifiNameWindows() string { + return parseWlanNetsh("SSID") +} + +func parseWlanNetsh(target string) string { + cmd := exec.Command("netsh.exe", "wlan", "show", "interfaces") + out, err := cmd.Output() + if err != nil { + return "" + } + splits := strings.Split(string(out), "\n") + var words []string + for _, line := range splits { + token := strings.Split(string(line), ":") + for _, word := range token { + words = append(words, strings.TrimSpace(word)) + } + } + for i, token := range words { + switch token { + case target: + return words[i+1] + i++ + } + } + return "N/A" +} From 76bc33c7e6c1140d1191355333061d2143ff4c7f Mon Sep 17 00:00:00 2001 From: Federico Ruggi Date: Tue, 31 Jul 2018 16:43:42 +0200 Subject: [PATCH 2/8] do not set focus if already taken by widget --- wtf/focus_tracker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wtf/focus_tracker.go b/wtf/focus_tracker.go index 44703b18..c0a8eab6 100644 --- a/wtf/focus_tracker.go +++ b/wtf/focus_tracker.go @@ -34,6 +34,9 @@ func (tracker *FocusTracker) AssignHotKeys() { } func (tracker *FocusTracker) FocusOn(char string) { + if tracker.focusState() == NonWidget { + return + } for idx, focusable := range tracker.focusables() { if focusable.FocusChar() == char { tracker.blur(tracker.Idx) From ac395f4ea68ba44068b50af8193fa27b16fdc84a Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 31 Jul 2018 09:54:10 -0700 Subject: [PATCH 3/8] Add smoke weather emoji because the PNW is burning this week --- weatherservices/weather/emoji.go | 1 + 1 file changed, 1 insertion(+) diff --git a/weatherservices/weather/emoji.go b/weatherservices/weather/emoji.go index 15dafe82..c1463c08 100644 --- a/weatherservices/weather/emoji.go +++ b/weatherservices/weather/emoji.go @@ -28,6 +28,7 @@ var weatherEmoji = map[string]string{ "partly cloudy": "🌤", "scattered clouds": "🌤", "shower rain": "☔️", + "smoke": "🔥", "snow": "❄️", "sunny": "☀️", "thunderstorm": "⛈", From 015d7736db0440706f95436e5dddcaa652b735c8 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 31 Jul 2018 10:04:59 -0700 Subject: [PATCH 4/8] Closes #263. Fix spelling of GitHub in public-facing strings --- _site/content/posts/modules/github.md | 16 ++++++++-------- _site/themes/hyde-hyde/layouts/index.html | 4 ++-- docs/index.html | 4 ++-- docs/index.xml | 10 +++++----- docs/posts/index.xml | 10 +++++----- docs/posts/modules/bittrex/index.html | 6 +++--- docs/posts/modules/cryptolive/index.html | 6 +++--- docs/posts/modules/github/index.html | 16 ++++++++-------- github/widget.go | 4 ++-- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/_site/content/posts/modules/github.md b/_site/content/posts/modules/github.md index 01d949e6..3c54b776 100644 --- a/_site/content/posts/modules/github.md +++ b/_site/content/posts/modules/github.md @@ -4,7 +4,7 @@ date: 2018-05-09T19:20:20-07:00 draft: false --- -Displays information about your git repositories hosted on Github: +Displays information about your git repositories hosted on GitHub: #### Open Review Requests @@ -23,21 +23,21 @@ All open pull requests created by you. wtf/github/ ``` -## Github Required ENV Variables +## GitHub Required ENV Variables Key: `WTF_GITHUB_TOKEN`
-Action: Your Github API token. +Action: Your GitHub API token. ## GitHub Enterprise Required ENV Variables Key: `WTF_GITHUB_TOKEN`
-Action: Your Github API token. +Action: Your GitHub API token. Key: `WTF_GITHUB_BASE_URL`
-Action: Your Github Enterprise API URL. +Action: Your GitHub Enterprise API URL. Key: `WTF_GITHUB_UPLOAD_URL`
-Action: Your Github Enterprise upload URL (often the same as API URL). +Action: Your GitHub Enterprise upload URL (often the same as API URL). ## Keyboard Commands @@ -93,11 +93,11 @@ How often, in seconds, this module will update its data.
Values: A positive integer, `0..n`. `repositories`
-A list of key/value pairs each describing a Github repository to fetch data +A list of key/value pairs each describing a GitHub repository to fetch data for.
Key: The name of the repository.
Value: The name of the account or organization that owns the repository. `username`
-Your Github username. Used to figure out which review requests you've +Your GitHub username. Used to figure out which review requests you've been added to. diff --git a/_site/themes/hyde-hyde/layouts/index.html b/_site/themes/hyde-hyde/layouts/index.html index a8b97c4e..160f0f67 100644 --- a/_site/themes/hyde-hyde/layouts/index.html +++ b/_site/themes/hyde-hyde/layouts/index.html @@ -16,7 +16,7 @@

Keep an eye on your OpsGenie schedules, Google Calendar, Git - and Github repositories, and New Relic deployments. + and GitHub repositories, and New Relic deployments.

@@ -28,7 +28,7 @@

Download Latest - Source on Github + Source on GitHub Chat on Gitter Follow on Twitter diff --git a/docs/index.html b/docs/index.html index 4dda3966..cbf5cf1b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -132,7 +132,7 @@ height="0" width="0" style="display:none;visibility:hidden">

Keep an eye on your OpsGenie schedules, Google Calendar, Git - and Github repositories, and New Relic deployments. + and GitHub repositories, and New Relic deployments.

@@ -144,7 +144,7 @@ height="0" width="0" style="display:none;visibility:hidden">

Download Latest - Source on Github + Source on GitHub Chat on Gitter Follow on Twitter diff --git a/docs/index.xml b/docs/index.xml index c81331b8..5c524cdc 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -379,13 +379,13 @@ Configuration gcal:colors:title:"red"description:"lightb Wed, 09 May 2018 19:20:20 -0700 https://wtfutil.com/posts/modules/github/ - Displays information about your git repositories hosted on Github: + Displays information about your git repositories hosted on GitHub: Open Review Requests All open code review requests assigned to you. Open Pull Requests All open pull requests created by you. -Source Code wtf/github/ Github Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your Github API token. -GitHub Enterprise Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your Github API token. -Key: WTF_GITHUB_BASE_URL Action: Your Github Enterprise API URL. -Key: WTF_GITHUB_UPLOAD_URL Action: Your Github Enterprise upload URL (often the same as API URL). +Source Code wtf/github/ GitHub Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your GitHub API token. +GitHub Enterprise Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your GitHub API token. +Key: WTF_GITHUB_BASE_URL Action: Your GitHub Enterprise API URL. +Key: WTF_GITHUB_UPLOAD_URL Action: Your GitHub Enterprise upload URL (often the same as API URL). diff --git a/docs/posts/index.xml b/docs/posts/index.xml index aac5c176..7600a594 100644 --- a/docs/posts/index.xml +++ b/docs/posts/index.xml @@ -379,13 +379,13 @@ Configuration gcal:colors:title:"red"description:"lightb Wed, 09 May 2018 19:20:20 -0700 https://wtfutil.com/posts/modules/github/ - Displays information about your git repositories hosted on Github: + Displays information about your git repositories hosted on GitHub: Open Review Requests All open code review requests assigned to you. Open Pull Requests All open pull requests created by you. -Source Code wtf/github/ Github Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your Github API token. -GitHub Enterprise Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your Github API token. -Key: WTF_GITHUB_BASE_URL Action: Your Github Enterprise API URL. -Key: WTF_GITHUB_UPLOAD_URL Action: Your Github Enterprise upload URL (often the same as API URL). +Source Code wtf/github/ GitHub Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your GitHub API token. +GitHub Enterprise Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your GitHub API token. +Key: WTF_GITHUB_BASE_URL Action: Your GitHub Enterprise API URL. +Key: WTF_GITHUB_UPLOAD_URL Action: Your GitHub Enterprise upload URL (often the same as API URL). diff --git a/docs/posts/modules/bittrex/index.html b/docs/posts/modules/bittrex/index.html index 8ab9753c..0b0dd359 100644 --- a/docs/posts/modules/bittrex/index.html +++ b/docs/posts/modules/bittrex/index.html @@ -99,7 +99,7 @@ Git