diff --git a/.all-contributorsrc b/.all-contributorsrc index f0232bd6..e9f769c0 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -217,6 +217,34 @@ "name": "Jagdeep Singh", "avatar_url": "https://avatars3.githubusercontent.com/u/3717137?v=4", "profile": "https://jagdeep.me", + "contributions": [] + }, + { + "login": "darkSasori", + "name": "Lineu Felipe", + "avatar_url": "https://avatars0.githubusercontent.com/u/889171?v=4", + "profile": "https://github.com/darkSasori", + "contributions": [] + }, + { + "login": "kvj", + "name": "Konstantin", + "avatar_url": "https://avatars2.githubusercontent.com/u/159124?v=4", + "profile": "https://github.com/kvj", + "contributions": [] + }, + { + "login": "brendano86", + "name": "Brendan O'Leary", + "avatar_url": "https://avatars2.githubusercontent.com/u/6044920?v=4", + "profile": "http://www.brendanoleary.com", + "contributions": [] + }, + { + "login": "bertl4398", + "name": "bertl4398", + "avatar_url": "https://avatars2.githubusercontent.com/u/1226441?v=4", + "profile": "https://github.com/bertl4398", "contributions": [ ] } diff --git a/.gitignore b/.gitignore index 2d038a3c..6dde8d37 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ .DS_Store gcal/client_secret.json gspreadsheets/client_secret.json +profile.pdf + #intellij idea .idea/ diff --git a/Gopkg.lock b/Gopkg.lock index 12d9fb8b..cf2d4090 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -4,8 +4,8 @@ [[projects]] name = "cloud.google.com/go" packages = ["compute/metadata"] - revision = "777200caa7fb8936aed0f12b1fd79af64cc83ec9" - version = "v0.24.0" + revision = "aad3f485ee528456e0768f20397b4d9dd941e755" + version = "v0.25.0" [[projects]] branch = "master" @@ -25,6 +25,12 @@ packages = ["."] revision = "6a9abf92e34f4de62ac671caee3143f10b98892d" +[[projects]] + branch = "master" + name = "github.com/darkSasori/todoist" + packages = ["."] + revision = "ec6b38b374ab9c60cc9716d2083ae66eb9383d03" + [[projects]] name = "github.com/davecgh/go-spew" packages = ["spew"] @@ -38,13 +44,13 @@ revision = "b23993cbb6353f0e6aa98d0ee318a34728f628b9" [[projects]] + branch = "master" name = "github.com/gdamore/tcell" packages = [ ".", "terminfo" ] - revision = "061d51a604c546b48e92253cb65190d76cecf4c6" - version = "v1.0.0" + revision = "de7e78efa4a71b3f36c7154989c529dbdf9ae623" [[projects]] name = "github.com/golang/protobuf" @@ -56,7 +62,7 @@ branch = "master" name = "github.com/google/go-github" packages = ["github"] - revision = "60d040d2dafa18fa3e86cbf22fbc3208ef9ef1e0" + revision = "c0b63e2f9bb198baf328c8abf1ddcbe05ff9427e" [[projects]] branch = "master" @@ -94,6 +100,12 @@ revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" +[[projects]] + name = "github.com/pkg/profile" + packages = ["."] + revision = "5b67d428864e92711fcbd2f8629456121a56d91f" + version = "v1.2.1" + [[projects]] name = "github.com/pmezard/go-difflib" packages = ["difflib"] @@ -110,7 +122,7 @@ branch = "master" name = "github.com/rivo/tview" packages = ["."] - revision = "83483397e826c343edb7b8c1f33fb7983dda9fc5" + revision = "c33dd0cf8ef840e1c8905c838d5b1ce93050a825" [[projects]] name = "github.com/stretchr/testify" @@ -122,7 +134,7 @@ branch = "master" name = "github.com/xanzy/go-gitlab" packages = ["."] - revision = "6ada444068f460636db26ca0dd66cf2aa518fa8f" + revision = "fb3ece09ef3e80cfa5c1e52dc75fcfb56c12e026" [[projects]] branch = "master" @@ -143,7 +155,7 @@ "context", "context/ctxhttp" ] - revision = "e514e69ffb8bc3c76a71ae40de0118d794855992" + revision = "8887df42c721e930089d31b28391090a10a497d7" [[projects]] branch = "master" @@ -179,7 +191,7 @@ "googleapi/internal/uritemplates", "sheets/v4" ] - revision = "082d671a2a341aa205b22b580fa69747dcc3cdc8" + revision = "efcb5f25ac56eae06c8b5672456c0b7767522685" [[projects]] name = "google.golang.org/appengine" diff --git a/Gopkg.toml b/Gopkg.toml index 6221a4d7..5d0dae04 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -31,11 +31,11 @@ [[constraint]] name = "github.com/gdamore/tcell" - version = "1.0.0" + branch = "master" -[[constraint]] - name = "github.com/go-test/deep" - version = "1.0.1" +#[[constraint]] + #name = "github.com/go-test/deep" + #version = "1.0.1" [[constraint]] name = "github.com/google/go-github" @@ -54,36 +54,40 @@ version = "1.4.0" [[constraint]] - branch = "master" name = "github.com/olebedev/config" + branch = "master" [[constraint]] name = "github.com/radovskyb/watcher" version = "1.0.2" [[constraint]] - branch = "master" name = "github.com/rivo/tview" + branch = "master" [[constraint]] - branch = "master" name = "github.com/yfronto/newrelic" + branch = "master" [[constraint]] - branch = "master" name = "golang.org/x/oauth2" + branch = "master" [[constraint]] - branch = "master" name = "google.golang.org/api" + branch = "master" [[constraint]] name = "gopkg.in/yaml.v2" version = "2.2.1" [[constraint]] - branch = "master" name = "github.com/adlio/trello" + branch = "master" + +[[constraint]] + name = "github.com/darkSasori/todoist" + branch = "master" [prune] go-tests = true diff --git a/Makefile b/Makefile index 19d63ae6..bde2f7a7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: contrib_check dependencies install run +.PHONY: contrib_check dependencies install run size build: go build -o bin/wtf @@ -8,8 +8,11 @@ contrib_check: install: go clean - go install -ldflags="-X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)" + go install -ldflags="-s -w -X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)" which wtf run: build bin/wtf + +size: + loc --exclude vendor/ _sample_configs/ _site/ docs/ Makefile *.md *.toml diff --git a/README.md b/README.md index ab4e5848..3415e3ae 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Thanks goes to these wonderful people: | [
baustinanki](https://github.com/baustinanki)
| [
lucus lee](https://github.com/lixin9311)
| [
Mike Lloyd](https://github.com/mxplusb)
| [
Sergio Rubio](http://rubiojr.rbel.co)
| [
Farhad Farahi](https://github.com/FarhadF)
| [
Lasantha Kularatne](http://lasantha.blogspot.com/)
| [
Mark Old](https://github.com/dlom)
| | [
flw](http://flw.tools/)
| [
David Barda](https://github.com/davebarda)
| [
Geoff Lee](https://github.com/matrinox)
| [
George Opritescu](http://international.github.io)
| [
Grazfather](https://twitter.com/Grazfather)
| [
Michael Cordell](http://www.mikecordell.com/)
| [
Patrick José Pereira](http://patrick.ibexcps.com)
| | [
sherod taylor](https://github.com/sherodtaylor)
| [
Andrew Scott](http://cogentia.io)
| [
Anand Sudhir Prayaga](https://github.com/anandsudhir)
| [
Lassi Piironen](https://github.com/lsipii)
| [
BlackWebWolf](https://github.com/BlackWebWolf)
| [
andrewzolotukhin](https://github.com/andrewzolotukhin)
| [
Leon Stigter](https://retgits.github.io)
| -| [
Amr Tamimi](https://tamimi.se)
| [
Jagdeep Singh](https://jagdeep.me)
| +| [
Amr Tamimi](https://tamimi.se)
| [
Jagdeep Singh](https://jagdeep.me)
| [
Lineu Felipe](https://github.com/darkSasori)
| [
Konstantin](https://github.com/kvj)
| [
Brendan O'Leary](http://www.brendanoleary.com)
| [
bertl4398](https://github.com/bertl4398)
| This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! diff --git a/_sample_configs/complex_config.yml b/_sample_configs/complex_config.yml index 5983683e..7937761b 100644 --- a/_sample_configs/complex_config.yml +++ b/_sample_configs/complex_config.yml @@ -203,10 +203,12 @@ wtf: width: 1 refreshInterval: 3600 weather: + apiKey: [YOUR API KEY] # From http://openweathermap.org/help/city_list.txt cityids: - 3370352 - 1283240 + WTF_OWM_API_KEY: [YOUR API KEY] colors: current: "lightblue" enabled: true diff --git a/_site/content/posts/modules/gerrit.md b/_site/content/posts/modules/gerrit.md index 8c7e752c..e2b4837e 100644 --- a/_site/content/posts/modules/gerrit.md +++ b/_site/content/posts/modules/gerrit.md @@ -55,10 +55,12 @@ gerrit: height: 2 width: 2 refreshInterval: 300 + domain: https://gerrit-review.googlesource.com projects: - org/test-project" - dotfiles username: "myname" + verifyServerCertificate: false ``` ### Attributes @@ -75,7 +77,7 @@ How often, in seconds, this module will update its data.
Values: A positive integer, `0..n`. `domain`
-_Optional_. Your Gerrit corporate domain.
+Your Gerrit corporate domain.
Values: A valid URI. `projects`
diff --git a/_site/content/posts/modules/github.md b/_site/content/posts/modules/github.md index f81a6707..01d949e6 100644 --- a/_site/content/posts/modules/github.md +++ b/_site/content/posts/modules/github.md @@ -61,6 +61,7 @@ wtf/github/ ```yaml github: enabled: true + enableStatus: true position: top: 2 left: 3 @@ -79,6 +80,11 @@ github: Determines whether or not this module is executed and if its data displayed onscreen.
Values: `true`, `false`. +`enableStatus`
+Display pull request mergeability status ('dirty', 'clean', 'unstable', +'blocked').
+Values: `true`, `false`. + `position`
Defines where in the grid this module's widget will be displayed.
diff --git a/_site/content/posts/modules/gitlab.md b/_site/content/posts/modules/gitlab.md index df9f744f..1e48abe0 100644 --- a/_site/content/posts/modules/gitlab.md +++ b/_site/content/posts/modules/gitlab.md @@ -1,5 +1,5 @@ --- -title: "Gitlab" +title: "GitLab" date: 2018-06-08T13:14:11-07:00 draft: false --- @@ -8,7 +8,7 @@ Added in `v0.0.8`. gitlab screenshot -Displays information about your projects hosted on Gitlab: +Displays information about your projects hosted on GitLab: #### Open Approval Requests @@ -27,7 +27,7 @@ wtf/gitlab/ ## Required ENV Variables Key: `WTF_GITLAB_TOKEN`
-Action: A Gitlab personal access token. Requires at least `api` access. +Action: A GitLab personal access token. Requires at least `api` access. ## Keyboard Commands @@ -77,14 +77,14 @@ How often, in seconds, this module will update its data.
Values: A positive integer, `0..n`. `domain`
-_Optional_. Your Gitlab corporate domain.
+_Optional_. Your GitLab corporate domain.
Values: A valid URI. `projects`
-A list of key/value pairs each describing a Gitlab project to fetch data +A list of key/value pairs each describing a GitLab project to fetch data for.
Key: The name of the project.
Value: The namespace of the project. `username`
-Your Gitlab username. Used to figure out which requests require your approval +Your GitLab username. Used to figure out which requests require your approval diff --git a/_site/content/posts/modules/jenkins.md b/_site/content/posts/modules/jenkins.md index c556998e..326420c7 100644 --- a/_site/content/posts/modules/jenkins.md +++ b/_site/content/posts/modules/jenkins.md @@ -39,6 +39,7 @@ jenkins: refreshInterval: 300 url: "https://jenkins.domain.com/jenkins/view_url" user: "username" + verifyServerCertificate: true ``` ### Attributes @@ -61,3 +62,7 @@ Your Jenkins username.
The url to your Jenkins project or view.
Values: A valid URI. +`verifyServerCertificate`
+_Optional_
+Determines whether or not the server's certificate chain and host name are verified.
+Values: `true`, `false`. diff --git a/_site/content/posts/modules/jira.md b/_site/content/posts/modules/jira.md index 3daf62b7..081f4a31 100644 --- a/_site/content/posts/modules/jira.md +++ b/_site/content/posts/modules/jira.md @@ -21,7 +21,20 @@ wtf/jira/ ## Keyboard Commands -None. +Key: `[return]`
+Action: Open the selected issue in the browser. + +Key: `j`
+Action: Select the next item in the list. + +Key: `k`
+Action: Select the previous item in the list. + +Key: `↓`
+Action: Select the next item in the list. + +Key: `↑`
+Action: Select the previous item in the list. ## Configuration diff --git a/_site/content/posts/modules/todoist.md b/_site/content/posts/modules/todoist.md new file mode 100644 index 00000000..9381b5b8 --- /dev/null +++ b/_site/content/posts/modules/todoist.md @@ -0,0 +1,91 @@ +--- +title: "Todoist" +date: 2018-07-05T22:55:55-03:00 +draft: false +--- + +Added in `v0.0.11`. + +Displays all items on specified project. + +todoist screenshot + +## Source Code + +```bash +wtf/todoist/ +``` + +## Required ENV Variables + +Key: `WTF_TODOIST_TOKEN`
+Value: Your Todoist API Token.
+ +_You can get your API Token at: todoist.com/prefs/integrations._ + +## Keyboard Commands + +Key: `h`
+Action: Show the previous project. + +Key: `←`
+Action: Show the previous project. + +Key: `l`
+Action: Show the next project. + +Key: `→`
+Action: Show the next project. + +Key: `j`
+Action: Select the next item in the list. + +Key: `↓`
+Action: Select the next item in the list. + +Key: `k`
+Action: Select the previous item in the list. + +Key: `↑`
+Action: Select the previous item in the list. + +Key: `c`
+Action: Close current item. + +Key: `d`
+Action: Delete current item. + +Key: `r`
+Action: Reload all projects. + +## Configuration + +```yaml +todoist: + enabled: true + position: + top: 0 + left: 2 + height: 1 + width: 1 + projects: + - 122247497 + refreshInterval: 3600 +``` + +### Attributes + +`enabled`
+Determines whether or not this module is executed and if its data displayed onscreen.
+Values: `true`, `false`. + +`position`
+Where in the grid this module's widget will be displayed.
+ +`projects`
+The todoist projects to fetch items from.
+Values: The integer ID of the project. + +`refreshInterval`
+How often, in seconds, this module will update its data.
+Values: A positive integer, `0..n`. diff --git a/_site/content/posts/modules/travisci.md b/_site/content/posts/modules/travisci.md new file mode 100644 index 00000000..dc683dbc --- /dev/null +++ b/_site/content/posts/modules/travisci.md @@ -0,0 +1,52 @@ +--- +title: "TravisCI" +date: 2018-07-18T14:36:08-04:00 +draft: false +--- + +Added in `v0.0.12`. + +Displays build information for your Travis CI account. + +travisci screenshot + +## Source Code + +```bash +wtf/travisci/ +``` + +## Required ENV Variables + +Key: `WTF_TRAVIS_API_TOKEN`
+Value: Your Travis CI API access token. + +## Keyboard Commands + +None. + +## Configuration + +```yaml +travisci: + enabled: true + position: + top: 4 + left: 1 + height: 1 + width: 2 + refreshInterval: 900 +``` + +### Attributes + +`enabled`
+Determines whether or not this module is executed and if its data displayed onscreen.
+Values: `true`, `false`. + +`position`
+Defines where in the grid this module's widget will be displayed.
+ +`refreshInterval`
+How often, in seconds, this module will update its data.
+Values: A positive integer, `0..n`. diff --git a/_site/content/posts/modules/weather.md b/_site/content/posts/modules/weather.md index c7cb5052..a6fff7de 100644 --- a/_site/content/posts/modules/weather.md +++ b/_site/content/posts/modules/weather.md @@ -17,8 +17,11 @@ wtf/weather/ ## Required ENV Variables + + Key: `WTF_OWM_API_KEY`
-Action: Your OpenWeatherMap API key. +Action: Your OpenWeatherMap API key.
+Note: DEPRECATED. See the `apiKey` config value, below. ## Keyboard Commands @@ -41,6 +44,7 @@ wtf/weather/ ```yaml weather: + apiKey: "2dfb3e3650a1950adddb6badf5ba1aaa" # From http://openweathermap.org/help/city_list.txt cityids: - 6173331 @@ -62,6 +66,9 @@ weather: ### Attributes +`apiKey`
+Your OpenWeatherMap API key. + `cityids`
A list of the OpenWeatherMap city diff --git a/_site/static/imgs/modules/todoist.png b/_site/static/imgs/modules/todoist.png new file mode 100644 index 00000000..086d0ec8 Binary files /dev/null and b/_site/static/imgs/modules/todoist.png differ diff --git a/_site/static/imgs/modules/travisci.png b/_site/static/imgs/modules/travisci.png new file mode 100644 index 00000000..eb423fa9 Binary files /dev/null and b/_site/static/imgs/modules/travisci.png differ diff --git a/_site/themes/hyde-hyde/layouts/partials/sidebar.html b/_site/themes/hyde-hyde/layouts/partials/sidebar.html index 3bb31b75..253dfcef 100644 --- a/_site/themes/hyde-hyde/layouts/partials/sidebar.html +++ b/_site/themes/hyde-hyde/layouts/partials/sidebar.html @@ -32,7 +32,7 @@ - + @@ -47,6 +47,8 @@ + + diff --git a/checklist/checklist.go b/checklist/checklist.go new file mode 100644 index 00000000..af55b03c --- /dev/null +++ b/checklist/checklist.go @@ -0,0 +1,187 @@ +package checklist + +// Checklist is a module for creating generic checklist implementations +// See 'Todo' for an implementation example +type Checklist struct { + Selected int + + Items []*ChecklistItem +} + +func NewChecklist() Checklist { + list := Checklist{ + Selected: -1, + } + + return list +} + +/* -------------------- Exported Functions -------------------- */ + +// Add creates a new item in the checklist +func (list *Checklist) Add(checked bool, text string) { + item := ChecklistItem{ + Checked: checked, + Text: text, + } + + list.Items = append([]*ChecklistItem{&item}, list.Items...) +} + +// CheckedItems returns a slice of all the checked items +func (list *Checklist) CheckedItems() []*ChecklistItem { + items := []*ChecklistItem{} + + for _, item := range list.Items { + if item.Checked { + items = append(items, item) + } + } + + return items +} + +// Delete removes the selected item from the checklist +func (list *Checklist) Delete() { + list.Items = append(list.Items[:list.Selected], list.Items[list.Selected+1:]...) + list.Prev() +} + +// Demote moves the selected item down in the checklist +func (list *Checklist) Demote() { + if list.IsUnselectable() { + return + } + + j := list.Selected + 1 + if j >= len(list.Items) { + j = 0 + } + + list.Swap(list.Selected, j) + list.Selected = j +} + +// IsSelectable returns true if the checklist has selectable items, false if it does not +func (list *Checklist) IsSelectable() bool { + return list.Selected >= 0 && list.Selected < len(list.Items) +} + +// IsUnselectable returns true if the checklist has no selectable items, false if it does +func (list *Checklist) IsUnselectable() bool { + return !list.IsSelectable() +} + +// Next selects the next item in the checklist +func (list *Checklist) Next() { + list.Selected = list.Selected + 1 + if list.Selected >= len(list.Items) { + list.Selected = 0 + } +} + +// LongestLine returns the length of the longest checklist item's text +func (list *Checklist) LongestLine() int { + maxLen := 0 + + for _, item := range list.Items { + if len(item.Text) > maxLen { + maxLen = len(item.Text) + } + } + + return maxLen +} + +// Prev selects the previous item in the checklist +func (list *Checklist) Prev() { + list.Selected = list.Selected - 1 + if list.Selected < 0 { + list.Selected = len(list.Items) - 1 + } +} + +// Promote moves the selected item up in the checklist +func (list *Checklist) Promote() { + if list.IsUnselectable() { + return + } + + j := list.Selected - 1 + if j < 0 { + j = len(list.Items) - 1 + } + + list.Swap(list.Selected, j) + list.Selected = j +} + +// SelectedItem returns the currently-selected checklist item or nil if no item is selected +func (list *Checklist) SelectedItem() *ChecklistItem { + if list.IsUnselectable() { + return nil + } + + return list.Items[list.Selected] +} + +func (list *Checklist) SetSelectedByItem(selectableItem *ChecklistItem) { + for idx, item := range list.Items { + if item == selectableItem { + list.Selected = idx + break + } + } +} + +// Toggle switches the checked state of the currently-selected item +func (list *Checklist) Toggle() { + if list.IsUnselectable() { + return + } + + list.SelectedItem().Toggle() +} + +// UncheckedItems returns a slice of all the unchecked items +func (list *Checklist) UncheckedItems() []*ChecklistItem { + items := []*ChecklistItem{} + + for _, item := range list.Items { + if !item.Checked { + items = append(items, item) + } + } + + return items +} + +// Unselect removes the current select such that no item is selected +func (list *Checklist) Unselect() { + list.Selected = -1 +} + +// Update sets the text of the currently-selected item to the provided text +func (list *Checklist) Update(text string) { + item := list.SelectedItem() + + if item == nil { + return + } + + item.Text = text +} + +/* -------------------- Sort Interface -------------------- */ + +func (list *Checklist) Len() int { + return len(list.Items) +} + +func (list *Checklist) Less(i, j int) bool { + return list.Items[i].Text < list.Items[j].Text +} + +func (list *Checklist) Swap(i, j int) { + list.Items[i], list.Items[j] = list.Items[j], list.Items[i] +} diff --git a/checklist/checklist_item.go b/checklist/checklist_item.go new file mode 100644 index 00000000..f1bb1547 --- /dev/null +++ b/checklist/checklist_item.go @@ -0,0 +1,27 @@ +package checklist + +import ( + "github.com/senorprogrammer/wtf/wtf" +) + +// ChecklistItem is a module for creating generic checklist implementations +// See 'Todo' for an implementation example +type ChecklistItem struct { + Checked bool + Text string +} + +// CheckMark returns the string used to indicate a ChecklistItem is checked or unchecked +func (item *ChecklistItem) CheckMark() string { + if item.Checked { + return wtf.Config.UString("wtf.mods.todo.checkedIcon", "x") + } else { + return " " + } +} + +// Toggle changes the checked state of the ChecklistItem +// If checked, it is unchecked. If unchecked, it is checked +func (item *ChecklistItem) Toggle() { + item.Checked = !item.Checked +} diff --git a/checklisttests/checklist_item_test.go b/checklisttests/checklist_item_test.go new file mode 100644 index 00000000..8337dc04 --- /dev/null +++ b/checklisttests/checklist_item_test.go @@ -0,0 +1,43 @@ +package wtftests + +import ( + "testing" + + "github.com/olebedev/config" + . "github.com/senorprogrammer/wtf/checklist" + "github.com/senorprogrammer/wtf/wtf" + . "github.com/stretchr/testify/assert" +) + +/* -------------------- CheckMark -------------------- */ + +func TestCheckMark(t *testing.T) { + loadConfig() + + item := ChecklistItem{} + Equal(t, " ", item.CheckMark()) + + item = ChecklistItem{Checked: true} + Equal(t, "x", item.CheckMark()) +} + +/* -------------------- Toggle -------------------- */ + +func TestToggle(t *testing.T) { + loadConfig() + + item := ChecklistItem{} + Equal(t, false, item.Checked) + + item.Toggle() + Equal(t, true, item.Checked) + + item.Toggle() + Equal(t, false, item.Checked) +} + +/* -------------------- helpers -------------------- */ + +func loadConfig() { + wtf.Config, _ = config.ParseYamlFile("../_sample_configs/simple_config.yml") +} diff --git a/cmdrunner/widget.go b/cmdrunner/widget.go index 62183b4d..8318bd9a 100644 --- a/cmdrunner/widget.go +++ b/cmdrunner/widget.go @@ -5,6 +5,7 @@ import ( "os/exec" "strings" + "github.com/rivo/tview" "github.com/senorprogrammer/wtf/wtf" ) @@ -33,7 +34,7 @@ func (widget *Widget) Refresh() { widget.UpdateRefreshedAt() widget.execute() - title := wtf.Config.UString("wtf.mods.cmdrunner.title", widget.String()) + title := tview.TranslateANSI(wtf.Config.UString("wtf.mods.cmdrunner.title", widget.String())) widget.View.SetTitle(title) widget.View.SetText(widget.result) @@ -46,5 +47,5 @@ func (widget *Widget) String() string { func (widget *Widget) execute() { cmd := exec.Command(widget.cmd, widget.args...) - widget.result = wtf.ExecuteCommand(cmd) + widget.result = tview.TranslateANSI(wtf.ExecuteCommand(cmd)) } diff --git a/docs/404.html b/docs/404.html index 2e9ef6b7..ee6de015 100644 --- a/docs/404.html +++ b/docs/404.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/categories/index.html b/docs/categories/index.html index 1893a8de..db2efb7d 100644 --- a/docs/categories/index.html +++ b/docs/categories/index.html @@ -87,7 +87,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -102,6 +102,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/imgs/modules/todoist.png b/docs/imgs/modules/todoist.png new file mode 100644 index 00000000..086d0ec8 Binary files /dev/null and b/docs/imgs/modules/todoist.png differ diff --git a/docs/imgs/modules/travisci.png b/docs/imgs/modules/travisci.png new file mode 100644 index 00000000..eb423fa9 Binary files /dev/null and b/docs/imgs/modules/travisci.png differ diff --git a/docs/index.html b/docs/index.html index 5808c8f2..5eb51260 100644 --- a/docs/index.html +++ b/docs/index.html @@ -86,7 +86,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -101,6 +101,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/index.xml b/docs/index.xml index f9314eb0..0cee85dc 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -6,11 +6,41 @@ Recent content on WTF - A Terminal Dashboard Hugo -- gohugo.io en-us - Wed, 27 Jun 2018 15:55:42 -0700 + Wed, 18 Jul 2018 14:36:08 -0400 + + TravisCI + https://wtfutil.com/posts/modules/travisci/ + Wed, 18 Jul 2018 14:36:08 -0400 + + https://wtfutil.com/posts/modules/travisci/ + Added in v0.0.12. +Displays build information for your Travis CI account. +Source Code wtf/travisci/ Required ENV Variables Key: WTF_TRAVIS_API_TOKEN Value: Your Travis CI API access token. +Keyboard Commands None. +Configuration travisci:enabled:trueposition:top:4left:1height:1width:2refreshInterval:900 Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false. +position Defines where in the grid this module&rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data. + + + + Todoist + https://wtfutil.com/posts/modules/todoist/ + Thu, 05 Jul 2018 22:55:55 -0300 + + https://wtfutil.com/posts/modules/todoist/ + Added in v0.0.11. +Displays all items on specified project. +Source Code wtf/todoist/ Required ENV Variables Key: WTF_TODOIST_TOKEN Value: Your Todoist API Token. You can get your API Token at: todoist.com/prefs/integrations. +Keyboard Commands Key: h Action: Show the previous project. +Key: ← Action: Show the previous project. +Key: l Action: Show the next project. +Key: → Action: Show the next project. +Key: j Action: Select the next item in the list. + + Gerrit https://wtfutil.com/posts/modules/gerrit/ @@ -112,22 +142,22 @@ position Where in the grid this module&rsquo;s widget will be displayed. - Gitlab + GitLab https://wtfutil.com/posts/modules/gitlab/ Fri, 08 Jun 2018 13:14:11 -0700 https://wtfutil.com/posts/modules/gitlab/ Added in v0.0.8. -Displays information about your projects hosted on Gitlab: +Displays information about your projects hosted on GitLab: Open Approval Requests All open merge requests that are requesting your approval. Open Merge Requests All open merge requests created by you. -Source Code wtf/gitlab/ Required ENV Variables Key: WTF_GITLAB_TOKEN Action: A Gitlab personal access token. Requires at least api access. +Source Code wtf/gitlab/ Required ENV Variables Key: WTF_GITLAB_TOKEN Action: A GitLab personal access token. Requires at least api access. Keyboard Commands Key: / Action: Open/close the widget&rsquo;s help window. Key: h Action: Show the previous project. @@ -294,9 +324,11 @@ Key: j Action: Select the next item in the list. https://wtfutil.com/posts/modules/jira/ Displays all Jira issues assigned to you for the specified project. Source Code wtf/jira/ Required ENV Variables Key: WTF_JIRA_API_KEY Value: Your Jira API key. -Keyboard Commands None. -Configuration Single Jira Project jira:colors:rows:even:&#34;lightblue&#34;odd:&#34;white&#34;domain:&#34;https://umbrellacorp.atlassian.net&#34;email:&#34;chriscummer@me.com&#34;enabled:truejql:&#34;issueType = Story&#34;position:top:4left:1height:1width:2project:&#34;ProjectA&#34;refreshInterval:900username:&#34;chris.cummer&#34;verifyServerCertificate:true Multiple Jira Projects If you want to monitor multiple Jira projects, use the following configuration (note the difference in project): -jira:colors:rows:even:&#34;lightblue&#34;odd:&#34;white&#34;domain:&#34;https://umbrellacorp.atlassian.net&#34;email:&#34;chriscummer@me.com&#34;enabled:truejql:&#34;issueType = Story&#34;position:top:4left:1height:1width:2project:[&#34;ProjectA&#34;,&#34;ProjectB&#34;]refreshInterval:900username:&#34;chris.cummer&#34;verifyServerCertificate:true Attributes colors.rows.even Define the foreground color for even-numbered rows. Values: Any X11 color name. +Keyboard Commands Key: [return] Action: Open the selected issue in the browser. +Key: j Action: Select the next item in the list. +Key: k Action: Select the previous item in the list. +Key: ↓ Action: Select the next item in the list. +Key: ↑ Action: Select the previous item in the list. @@ -362,12 +394,11 @@ Key: h Action: Show the previous git repository. https://wtfutil.com/posts/modules/weather/ Displays a configurable list of current weather report, including current temperature, sunrise time, and sunset time. -Source Code wtf/weather/ Required ENV Variables Key: WTF_OWM_API_KEY Action: Your OpenWeatherMap API key. +Source Code wtf/weather/ Required ENV Variables Key: WTF_OWM_API_KEY Action: Your OpenWeatherMap API key. Note: DEPRECATED. See the apiKey config value, below. Keyboard Commands Key: / Action: Open/close the widget&rsquo;s help window. Key: h Action: Show the previous weather location. Key: l Action: Show the next weather location. -Key: ← Action: Show the previous weather location. -Key: → Action: Show the next weather location. +Key: ← Action: Show the previous weather location. diff --git a/docs/posts/configuration/attributes/index.html b/docs/posts/configuration/attributes/index.html index 8ad20352..126d33cb 100644 --- a/docs/posts/configuration/attributes/index.html +++ b/docs/posts/configuration/attributes/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/configuration/index.html b/docs/posts/configuration/index.html index 3fb8a0a2..e49c89d5 100644 --- a/docs/posts/configuration/index.html +++ b/docs/posts/configuration/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/configuration/iterm2/index.html b/docs/posts/configuration/iterm2/index.html index 428b0980..319ad5f7 100644 --- a/docs/posts/configuration/iterm2/index.html +++ b/docs/posts/configuration/iterm2/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/glossary/index.html b/docs/posts/glossary/index.html index 31e18fdf..f1d9cee4 100644 --- a/docs/posts/glossary/index.html +++ b/docs/posts/glossary/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/index.html b/docs/posts/index.html index 837c5820..ba7b8a29 100644 --- a/docs/posts/index.html +++ b/docs/posts/index.html @@ -87,7 +87,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -102,6 +102,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + @@ -120,6 +122,20 @@ height="0" width="0" style="display:none;visibility:hidden">

Posts

diff --git a/docs/posts/modules/bamboohr/index.html b/docs/posts/modules/bamboohr/index.html index ead69742..437c197a 100644 --- a/docs/posts/modules/bamboohr/index.html +++ b/docs/posts/modules/bamboohr/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/circleci/index.html b/docs/posts/modules/circleci/index.html index 506d3835..1ad44416 100644 --- a/docs/posts/modules/circleci/index.html +++ b/docs/posts/modules/circleci/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/clocks/index.html b/docs/posts/modules/clocks/index.html index a7a3fcc7..eab939e3 100644 --- a/docs/posts/modules/clocks/index.html +++ b/docs/posts/modules/clocks/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/cmdrunner/index.html b/docs/posts/modules/cmdrunner/index.html index e23d45cc..c11f9996 100644 --- a/docs/posts/modules/cmdrunner/index.html +++ b/docs/posts/modules/cmdrunner/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/cryptocurrencies/bittrex/index.html b/docs/posts/modules/cryptocurrencies/bittrex/index.html index 1496dbfe..68d8658e 100644 --- a/docs/posts/modules/cryptocurrencies/bittrex/index.html +++ b/docs/posts/modules/cryptocurrencies/bittrex/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/cryptocurrencies/blockfolio/index.html b/docs/posts/modules/cryptocurrencies/blockfolio/index.html index 5e67be49..5396e71d 100644 --- a/docs/posts/modules/cryptocurrencies/blockfolio/index.html +++ b/docs/posts/modules/cryptocurrencies/blockfolio/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/cryptocurrencies/cryptolive/index.html b/docs/posts/modules/cryptocurrencies/cryptolive/index.html index 8fe0beda..d24207f7 100644 --- a/docs/posts/modules/cryptocurrencies/cryptolive/index.html +++ b/docs/posts/modules/cryptocurrencies/cryptolive/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/gcal/index.html b/docs/posts/modules/gcal/index.html index 9c80a9b9..ae76f40f 100644 --- a/docs/posts/modules/gcal/index.html +++ b/docs/posts/modules/gcal/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/gerrit/index.html b/docs/posts/modules/gerrit/index.html index ec7e5f5a..d5cf8fee 100644 --- a/docs/posts/modules/gerrit/index.html +++ b/docs/posts/modules/gerrit/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + @@ -179,10 +181,12 @@ height="0" width="0" style="display:none;visibility:hidden"> height: 2 width: 2 refreshInterval: 300 + domain: https://gerrit-review.googlesource.com projects: - org/test-project" - dotfiles - username: "myname" + username: "myname" + verifyServerCertificate: false

Attributes

enabled
@@ -197,7 +201,7 @@ How often, in seconds, this module will update its data.
Values: A positive integer, 0..n.

domain
-Optional. Your Gerrit corporate domain.
+Your Gerrit corporate domain.
Values: A valid URI.

projects
diff --git a/docs/posts/modules/git/index.html b/docs/posts/modules/git/index.html index f90b4e13..bd1877a0 100644 --- a/docs/posts/modules/git/index.html +++ b/docs/posts/modules/git/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden">

- + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/github/index.html b/docs/posts/modules/github/index.html index 4580bea5..745d9573 100644 --- a/docs/posts/modules/github/index.html +++ b/docs/posts/modules/github/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + @@ -184,6 +186,7 @@ height="0" width="0" style="display:none;visibility:hidden">

Configuration

github:
   enabled: true
+  enableStatus: true
   position:
     top: 2
     left: 3
@@ -200,6 +203,11 @@ height="0" width="0" style="display:none;visibility:hidden">
 Determines whether or not this module is executed and if its data displayed onscreen. 
Values: true, false.

+

enableStatus
+Display pull request mergeability status (‘dirty’, ‘clean’, ‘unstable’, +‘blocked’).
+Values: true, false.

+

position
Defines where in the grid this module’s widget will be displayed.

diff --git a/docs/posts/modules/gitlab/index.html b/docs/posts/modules/gitlab/index.html index e0e91c79..9e0026fc 100644 --- a/docs/posts/modules/gitlab/index.html +++ b/docs/posts/modules/gitlab/index.html @@ -10,8 +10,8 @@ -Gitlab | WTF - A Terminal Dashboard - +GitLab | WTF - A Terminal Dashboard + @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + @@ -116,7 +118,7 @@ height="0" width="0" style="display:none;visibility:hidden">
-

Gitlab

+

GitLab

diff --git a/docs/posts/modules/gspreadsheet/index.html b/docs/posts/modules/gspreadsheet/index.html index 48726ddc..98981d92 100644 --- a/docs/posts/modules/gspreadsheet/index.html +++ b/docs/posts/modules/gspreadsheet/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/index.html b/docs/posts/modules/index.html index 86ea00db..5e47fd89 100644 --- a/docs/posts/modules/index.html +++ b/docs/posts/modules/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/ipapi/index.html b/docs/posts/modules/ipapi/index.html index 77be17f2..af1ead96 100644 --- a/docs/posts/modules/ipapi/index.html +++ b/docs/posts/modules/ipapi/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/ipinfo/index.html b/docs/posts/modules/ipinfo/index.html index 735a03fd..11c6dd47 100644 --- a/docs/posts/modules/ipinfo/index.html +++ b/docs/posts/modules/ipinfo/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + diff --git a/docs/posts/modules/jenkins/index.html b/docs/posts/modules/jenkins/index.html index 6bd495bf..e938715a 100644 --- a/docs/posts/modules/jenkins/index.html +++ b/docs/posts/modules/jenkins/index.html @@ -85,7 +85,7 @@ height="0" width="0" style="display:none;visibility:hidden"> - + @@ -100,6 +100,8 @@ height="0" width="0" style="display:none;visibility:hidden"> + + @@ -162,7 +164,8 @@ width="320" height="68" alt="jenkins screenshot" />

width: 3 refreshInterval: 300 url: "https://jenkins.domain.com/jenkins/view_url" - user: "username"
+ user: "username" + verifyServerCertificate: true

Attributes

enabled
@@ -183,6 +186,11 @@ Your Jenkins username.

The url to your Jenkins project or view.
Values: A valid URI.

+

verifyServerCertificate
+Optional
+Determines whether or not the server’s certificate chain and host name are verified.
+Values: true, false.

+