diff --git a/.all-contributorsrc b/.all-contributorsrc
index e9f769c0..43fd03bd 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -245,6 +245,20 @@
"name": "bertl4398",
"avatar_url": "https://avatars2.githubusercontent.com/u/1226441?v=4",
"profile": "https://github.com/bertl4398",
+ "contributions": []
+ },
+ {
+ "login": "Ferenc-",
+ "name": "Ferenc-",
+ "avatar_url": "https://avatars2.githubusercontent.com/u/6553695?v=4",
+ "profile": "https://github.com/Ferenc-",
+ "contributions": []
+ },
+ {
+ "login": "rhnvrm",
+ "name": "Rohan Verma",
+ "avatar_url": "https://avatars1.githubusercontent.com/u/952036?v=4",
+ "profile": "http://rohanverma.net",
"contributions": [
]
}
diff --git a/Gopkg.lock b/Gopkg.lock
index 6dc98de7..cf2d4090 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -142,6 +142,12 @@
packages = ["."]
revision = "7c9c2852e8f9e69a80bff4f4f1fe4cdd15eeba19"
+[[projects]]
+ branch = "master"
+ name = "github.com/zyedidia/highlight"
+ packages = ["."]
+ revision = "201131ce5cf5ba174570dcd878d1f2698db5af9f"
+
[[projects]]
branch = "master"
name = "golang.org/x/net"
@@ -213,6 +219,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
- inputs-digest = "8da356b338a76c5de5dce08eb73d808f139685850a2ef9ac3a9962197e36313f"
+ inputs-digest = "44328d9f71a21b64ed00b346dd77be8af49d0542f393f3e17c52de6125c57e24"
solver-name = "gps-cdcl"
solver-version = 1
diff --git a/README.md b/README.md
index 3415e3ae..56da3db3 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,9 @@
-
+[](https://travis-ci.com/senorprogrammer/wtf)
+[](https://gitter.im/wtfutil/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[](https://twitter.com/wtfutil)
+[](#contributors)
+[](https://goreportcard.com/report/github.com/senorprogrammer/wtf)
# WTF
@@ -55,7 +59,8 @@ 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)
| [
Lineu Felipe](https://github.com/darkSasori)
| [
Konstantin](https://github.com/kvj)
| [
Brendan O'Leary](http://www.brendanoleary.com)
| [
bertl4398](https://github.com/bertl4398)
|
+| [
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)
| [
Ferenc-](https://github.com/Ferenc-)
|
+| [
Rohan Verma](http://rohanverma.net)
|
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
@@ -68,19 +73,6 @@ The inspiration for `WTF` came from Monica Dinculescu's
Many thanks to Lendesk for supporting this project by
providing time to develop it.
-The following open-source libraries were used in the creation of `WTF`.
-Many thanks to all these developers.
-
-* [calendar](https://google.golang.org/api/calendar/v3)
-* [config](https://github.com/olebedev/config)
-* [go-gerrit](https://github.com/andygrunwald/go-gerrit)
-* [go-github](https://github.com/google/go-github)
-* [goreleaser](https://github.com/goreleaser/goreleaser)
-* [newrelic](https://github.com/yfronto/newrelic)
-* [openweathermap](https://github.com/briandowns/openweathermap)
-* [tcell](https://github.com/gdamore/tcell)
-* [tview](https://github.com/rivo/tview)
-
diff --git a/_site/content/posts/configuration/attributes.md b/_site/content/posts/configuration/attributes.md
index 2850875e..1f4a8a96 100644
--- a/_site/content/posts/configuration/attributes.md
+++ b/_site/content/posts/configuration/attributes.md
@@ -24,6 +24,7 @@ wtf:
# that support ten line of text, one of three lines, and one of four
rows: [10, 10, 10, 10, 10, 3, 4]
# The app redraws itself once a second
+ openFileUtil: open
refreshInterval: 1
term: "xterm-256color"
```
@@ -65,6 +66,9 @@ An array that defines the heights of all the rows.
Values: See tview's
Grid for details.
+`openFileUtil`
+Command to use to open a file or URL
+
`refreshInterval`
How often, in seconds, the UI refreshes itself.
**Note:** This implementation is probably wrong and buggy and likely to
diff --git a/_site/content/posts/modules/clocks.md b/_site/content/posts/modules/clocks.md
index 3d99e249..53864796 100644
--- a/_site/content/posts/modules/clocks.md
+++ b/_site/content/posts/modules/clocks.md
@@ -36,9 +36,10 @@ clocks:
Avignon: "Europe/Paris"
Barcelona: "Europe/Madrid"
Dubai: "Asia/Dubai"
+ New York: "America/New York"
+ Toronto: "America/Toronto"
UTC: "Etc/UTC"
Vancouver: "America/Vancouver"
- Toronto: "America/Toronto"
position:
top: 4
left: 0
diff --git a/_site/content/posts/modules/prettyweather.md b/_site/content/posts/modules/prettyweather.md
index 66a78c1e..24c0c4ca 100644
--- a/_site/content/posts/modules/prettyweather.md
+++ b/_site/content/posts/modules/prettyweather.md
@@ -37,6 +37,7 @@ None.
refreshInterval: 300
unit: "c"
view: 0
+ language: "en"
```
### Attributes
@@ -65,3 +66,7 @@ Values: `F` for Fahrenheit, `C` for Celcius.
`view`
_Optional_ Wttr.in view configuration.
Values: See `curl wttr.in/:help` for more details.
+
+`language`
+_Optional_ Wttr.in language configuration.
+Values: See `curl wttr.in/:translation` for more details.
diff --git a/clocks/widget.go b/clocks/widget.go
index 551ebda7..2d124bcd 100644
--- a/clocks/widget.go
+++ b/clocks/widget.go
@@ -1,6 +1,7 @@
package clocks
import (
+ "strings"
"time"
"github.com/senorprogrammer/wtf/wtf"
@@ -35,7 +36,7 @@ func (widget *Widget) buildClockCollection(locData map[string]interface{}) Clock
clockColl := ClockCollection{}
for label, locStr := range locData {
- timeLoc, err := time.LoadLocation(locStr.(string))
+ timeLoc, err := time.LoadLocation(widget.sanitizeLocation(locStr.(string)))
if err != nil {
continue
}
@@ -45,3 +46,7 @@ func (widget *Widget) buildClockCollection(locData map[string]interface{}) Clock
return clockColl
}
+
+func (widget *Widget) sanitizeLocation(locStr string) string {
+ return strings.Replace(locStr, " ", "_", -1)
+}
diff --git a/docs/index.xml b/docs/index.xml
index 0cee85dc..d8030ada 100644
--- a/docs/index.xml
+++ b/docs/index.xml
@@ -207,7 +207,7 @@ position Defines where in the grid this module’s widget will be displa
Displays weather information as ASCII art from Wttr.in.
Source Code wtf/prettyweather/ Required ENV Variables None.
Keyboard Commands None.
-Configuration prettyweather:enabled:truecity:"tehran"position:top:3left:5height:1width:1refreshInterval:300unit:"c"view:0 Attributes city Optional. It will grab the current location from your IP address if omitted.
+Configuration prettyweather:enabled:truecity:"tehran"position:top:3left:5height:1width:1refreshInterval:300unit:"c"view:0language:"en" Attributes city Optional. It will grab the current location from your IP address if omitted.
Values: The name of any city supported by Wttr.in.
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.
@@ -299,7 +299,7 @@ cmd The terminal command to be run, withouth the arguments. Ie: ping, whoami, cu
https://wtfutil.com/posts/configuration/attributes/
The following top-level attributes are configurable in config.yml. See this example config file for more details.
-wtf:colors:background:"red"border:Focusable:"darkslateblue"focused:"orange"normal:"gray"grid:# How _wide_ the columns are, in terminal characters. In this case we have# six columns, each of which are 35 characters widecolumns:[35,35,35,35,35,35]# How _high_ the rows are, in terminal lines. In this case we have five rows# that support ten line of text, one of three lines, and one of fourrows:[10,10,10,10,10,3,4]# The app redraws itself once a secondrefreshInterval:1term:"xterm-256color" Attributes colors.
+wtf:colors:background:"red"border:Focusable:"darkslateblue"focused:"orange"normal:"gray"grid:# How _wide_ the columns are, in terminal characters. In this case we have# six columns, each of which are 35 characters widecolumns:[35,35,35,35,35,35]# How _high_ the rows are, in terminal lines. In this case we have five rows# that support ten line of text, one of three lines, and one of fourrows:[10,10,10,10,10,3,4]# The app redraws itself once a secondopenFileUtil:openrefreshInterval:1term:"xterm-256color" Attributes colors.
-
@@ -475,7 +475,7 @@ position Defines where in the grid this module’s widget will be displa
Displays a configurable list of world clocks, the local time, and date.
Source Code wtf/clocks/ Required ENV Variables None.
Keyboard Commands None.
-Configuration clocks:colors:rows:even:"lightblue"odd:"white"enabled:truelocations:# From https://en.wikipedia.org/wiki/List_of_tz_database_time_zonesAvignon:"Europe/Paris"Barcelona:"Europe/Madrid"Dubai:"Asia/Dubai"UTC:"Etc/UTC"Vancouver:"America/Vancouver"Toronto:"America/Toronto"position:top:4left:0height:1width:1refreshInterval:15# Valid options are: alphabetical, chronologicalsort:"alphabetical" Attributes colors.rows.even The foreground color for even-numbered rows. Values: Any X11 color name.
+Configuration clocks:colors:rows:even:"lightblue"odd:"white"enabled:truelocations:# From https://en.wikipedia.org/wiki/List_of_tz_database_time_zonesAvignon:"Europe/Paris"Barcelona:"Europe/Madrid"Dubai:"Asia/Dubai"NewYork:"America/New York"Toronto:"America/Toronto"UTC:"Etc/UTC"Vancouver:"America/Vancouver"position:top:4left:0height:1width:1refreshInterval:15# Valid options are: alphabetical, chronologicalsort:"alphabetical" Attributes colors.rows.even The foreground color for even-numbered rows. Values: Any X11 color name.
colors.rows.odd The foreground color for the odd-numbered rows. Values: Any X11 color name.
enabled Determines whether or not this module is executed and if its data displayed onscreen.
diff --git a/docs/posts/configuration/attributes/index.html b/docs/posts/configuration/attributes/index.html
index 126d33cb..c8dfe1c4 100644
--- a/docs/posts/configuration/attributes/index.html
+++ b/docs/posts/configuration/attributes/index.html
@@ -154,6 +154,7 @@ See this # that support ten line of text, one of three lines, and one of four
rows: [10, 10, 10, 10, 10, 3, 4]
# The app redraws itself once a second
+ openFileUtil: open
refreshInterval: 1
term: "xterm-256color"
Attributes
@@ -193,6 +194,9 @@ An array that defines the heights of all the rows.
Values: See tview’s
Grid for details.
+openFileUtil
+Command to use to open a file or URL
+
refreshInterval
How often, in seconds, the UI refreshes itself.
Note: This implementation is probably wrong and buggy and likely to
diff --git a/docs/posts/index.xml b/docs/posts/index.xml
index 14be3c50..971ef72b 100644
--- a/docs/posts/index.xml
+++ b/docs/posts/index.xml
@@ -207,7 +207,7 @@ position Defines where in the grid this module’s widget will be displa
Displays weather information as ASCII art from Wttr.in.
Source Code wtf/prettyweather/ Required ENV Variables None.
Keyboard Commands None.
-Configuration prettyweather:enabled:truecity:"tehran"position:top:3left:5height:1width:1refreshInterval:300unit:"c"view:0 Attributes city Optional. It will grab the current location from your IP address if omitted.
+Configuration prettyweather:enabled:truecity:"tehran"position:top:3left:5height:1width:1refreshInterval:300unit:"c"view:0language:"en" Attributes city Optional. It will grab the current location from your IP address if omitted.
Values: The name of any city supported by Wttr.in.
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.
@@ -299,7 +299,7 @@ cmd The terminal command to be run, withouth the arguments. Ie: ping, whoami, cu
https://wtfutil.com/posts/configuration/attributes/
The following top-level attributes are configurable in config.yml. See this example config file for more details.
-wtf:colors:background:"red"border:Focusable:"darkslateblue"focused:"orange"normal:"gray"grid:# How _wide_ the columns are, in terminal characters. In this case we have# six columns, each of which are 35 characters widecolumns:[35,35,35,35,35,35]# How _high_ the rows are, in terminal lines. In this case we have five rows# that support ten line of text, one of three lines, and one of fourrows:[10,10,10,10,10,3,4]# The app redraws itself once a secondrefreshInterval:1term:"xterm-256color" Attributes colors.
+wtf:colors:background:"red"border:Focusable:"darkslateblue"focused:"orange"normal:"gray"grid:# How _wide_ the columns are, in terminal characters. In this case we have# six columns, each of which are 35 characters widecolumns:[35,35,35,35,35,35]# How _high_ the rows are, in terminal lines. In this case we have five rows# that support ten line of text, one of three lines, and one of fourrows:[10,10,10,10,10,3,4]# The app redraws itself once a secondopenFileUtil:openrefreshInterval:1term:"xterm-256color" Attributes colors.
-
@@ -475,7 +475,7 @@ position Defines where in the grid this module’s widget will be displa
Displays a configurable list of world clocks, the local time, and date.
Source Code wtf/clocks/ Required ENV Variables None.
Keyboard Commands None.
-Configuration clocks:colors:rows:even:"lightblue"odd:"white"enabled:truelocations:# From https://en.wikipedia.org/wiki/List_of_tz_database_time_zonesAvignon:"Europe/Paris"Barcelona:"Europe/Madrid"Dubai:"Asia/Dubai"UTC:"Etc/UTC"Vancouver:"America/Vancouver"Toronto:"America/Toronto"position:top:4left:0height:1width:1refreshInterval:15# Valid options are: alphabetical, chronologicalsort:"alphabetical" Attributes colors.rows.even The foreground color for even-numbered rows. Values: Any X11 color name.
+Configuration clocks:colors:rows:even:"lightblue"odd:"white"enabled:truelocations:# From https://en.wikipedia.org/wiki/List_of_tz_database_time_zonesAvignon:"Europe/Paris"Barcelona:"Europe/Madrid"Dubai:"Asia/Dubai"NewYork:"America/New York"Toronto:"America/Toronto"UTC:"Etc/UTC"Vancouver:"America/Vancouver"position:top:4left:0height:1width:1refreshInterval:15# Valid options are: alphabetical, chronologicalsort:"alphabetical" Attributes colors.rows.even The foreground color for even-numbered rows. Values: Any X11 color name.
colors.rows.odd The foreground color for the odd-numbered rows. Values: Any X11 color name.
enabled Determines whether or not this module is executed and if its data displayed onscreen.
diff --git a/docs/posts/modules/clocks/index.html b/docs/posts/modules/clocks/index.html
index eab939e3..e5f86457 100644
--- a/docs/posts/modules/clocks/index.html
+++ b/docs/posts/modules/clocks/index.html
@@ -162,9 +162,10 @@ height="0" width="0" style="display:none;visibility:hidden">
Avignon: "Europe/Paris"
Barcelona: "Europe/Madrid"
Dubai: "Asia/Dubai"
+ New York: "America/New York"
+ Toronto: "America/Toronto"
UTC: "Etc/UTC"
Vancouver: "America/Vancouver"
- Toronto: "America/Toronto"
position:
top: 4
left: 0
diff --git a/docs/posts/modules/prettyweather/index.html b/docs/posts/modules/prettyweather/index.html
index fc88defa..18fade25 100644
--- a/docs/posts/modules/prettyweather/index.html
+++ b/docs/posts/modules/prettyweather/index.html
@@ -162,7 +162,8 @@ height="0" width="0" style="display:none;visibility:hidden">
width: 1
refreshInterval: 300
unit: "c"
- view: 0
+ view: 0
+ language: "en"
Attributes
city
@@ -190,6 +191,10 @@ Values: F
for Fahrenheit, C
for Celcius.
Optional Wttr.in view configuration.
Values: See curl wttr.in/:help
for more details.
+language
+Optional Wttr.in language configuration.
+Values: See curl wttr.in/:translation
for more details.
+