diff --git a/_site/content/posts/configuration.md b/_site/content/posts/configuration.md index 183f0119..af97ed86 100644 --- a/_site/content/posts/configuration.md +++ b/_site/content/posts/configuration.md @@ -4,6 +4,12 @@ date: 2018-04-15T21:17:16-07:00 draft: false --- +## Index + +* [Configuration Files](#configuration-files) +* [Environment (ENV) Variables](#environment-env-variables) +* [Grid Layout](#grid-layout) + ## Configuration Files By default WTF looks in a `~/.wtf/` directory for a YAML file called @@ -51,3 +57,30 @@ wouldn't want to have laying about in the config files. For modules that require them, the name of the required environment variable(s) can be found in that module's "Required ENV Variables" section of the documentation. See OpsGenie for an example. + +## Grid Layout + +WTF uses the `Grid` layout system from [tview](https://github.com/rivo/tview/blob/master/grid.go) to position widgets +onscreen. It's not immediately obvious how this works, so here's an +explanation: + +Think of your terminal screen as a matrix of letter positions, say `100` chrs wide and `58` chrs tall. + +Columns breaks up the width of the screen into chunks, each chunk a specified number of characters wide. use + +`[10, 10, 10, 10, 10, 10, 10, 10, 10, 10]` + +Ten columns that are ten characters wide + +Rows break up the height of the screen into chunks, each chunk a specified number of characters tall. If we wanted to have five rows: + +`[10, 10, 10, 10, 18]` + +The co-ordinate system starts at top-left and defines how wide and tall a widget is. If we wanted to put a 2-col, 2-row widget in the bottom of the screen, we'd position it at: + +``` + top: 4 // top starts in the 4th row + left: 9 // left starts in the 9th column + height: 2 // span down rows 4 & 5 (18 characters in size, total) + width: 2 // span across cols 9 & 10 (20 characters in size, total) +``` diff --git a/_site/content/posts/modules/cryptocurrencies/cryptolive.md b/_site/content/posts/modules/cryptocurrencies/cryptolive.md new file mode 100644 index 00000000..7d511c0b --- /dev/null +++ b/_site/content/posts/modules/cryptocurrencies/cryptolive.md @@ -0,0 +1,88 @@ +--- +title: "Cryptolive" +date: 2018-06-03T20:06:40-07:00 +draft: false +--- + +Added in `v0.0.5`. + +Compare crypto currencies using [CryptoCompare](https://cryptocompare.com). + +## Source Code + +```bash +wtf/cryptocurrencies/cryptolive/ +``` + +## Required ENV Vars + +None. + +## Keyboard Commands + +None. + +## Configuration + +```yaml +cryptolive: + colors: + from: + name: coral + displayName: grey + to: + name: white + price: green + currencies: + BTC: + displayName: Bitcoin + to: + - USD + - EUR + - ETH + ETH: + displayName: Ethereum + to: + - USD + - EUR + - ETH + enabled: true + position: + top: 5 + left: 2 + height: 1 + width: 2 + refreshInterval: 30 + updateInterval: 15 +``` + +### Attributes + +`colors.from.name`
+Values: Any X11 +color name. + +`colors.from.dispayName`
+Values: Any X11 +color name. + +`colors.to.name`
+Values: Any X11 +color name. + +`colors.to.price`
+Values: Any X11 +color name. + +`currencies`
+ +`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/gcal.md b/_site/content/posts/modules/gcal.md index a5774fd3..3376f814 100644 --- a/_site/content/posts/modules/gcal.md +++ b/_site/content/posts/modules/gcal.md @@ -8,7 +8,7 @@ Displays your upcoming Google calendar events. gcal screenshot -**Not:** Setting up access to Google Calendars for Go is a bit unobvious. Check out Google's [Go Quickstart](https://developers.google.com/calendar/quickstart/go) +**Not:** Setting up access to Google Calendars for Go is a bit unobvious. Check out Google's [Go Quickstart](https://developers.google.com/calendar/quickstart/go) first and if you have problems, then take a look at this [comment by WesleydeSouza](https://github.com/senorprogrammer/wtf/issues/83#issuecomment-393665229) which offers a slightly different approach. ## Source Code diff --git a/_site/themes/hyde-hyde/layouts/partials/sidebar.html b/_site/themes/hyde-hyde/layouts/partials/sidebar.html index 8f91fd8e..dbf4b12b 100644 --- a/_site/themes/hyde-hyde/layouts/partials/sidebar.html +++ b/_site/themes/hyde-hyde/layouts/partials/sidebar.html @@ -24,6 +24,7 @@ + diff --git a/_site/themes/hyde-hyde/static/css/wtf.css b/_site/themes/hyde-hyde/static/css/wtf.css index 88213b04..ea13b9d6 100644 --- a/_site/themes/hyde-hyde/static/css/wtf.css +++ b/_site/themes/hyde-hyde/static/css/wtf.css @@ -27,6 +27,11 @@ span.caption { text-align: right; } +ul { + line-height: 22px !important; + margin-bottom: 14px !important; +} + .disabled { color: gray !important; cursor: not-allowed; diff --git a/bamboohr/widget.go b/bamboohr/widget.go index a2b5f443..5876f567 100644 --- a/bamboohr/widget.go +++ b/bamboohr/widget.go @@ -16,7 +16,7 @@ type Widget struct { func NewWidget() *Widget { widget := Widget{ - TextWidget: wtf.NewTextWidget(" ðŸ‘― BambooHR ", "bamboohr", false), + TextWidget: wtf.NewTextWidget(" BambooHR ", "bamboohr", false), } return &widget @@ -37,7 +37,7 @@ func (widget *Widget) Refresh() { ) widget.UpdateRefreshedAt() - widget.View.SetTitle(fmt.Sprintf(" ðŸ‘― Away (%d) ", len(todayItems))) + widget.View.SetTitle(fmt.Sprintf("%s(%d)", widget.Name, len(todayItems))) widget.View.SetText(fmt.Sprintf("%s", widget.contentFrom(todayItems))) } diff --git a/clocks/widget.go b/clocks/widget.go index 3dff6cae..0e1a7fdc 100644 --- a/clocks/widget.go +++ b/clocks/widget.go @@ -18,7 +18,7 @@ type Widget struct { func NewWidget() *Widget { widget := Widget{ - TextWidget: wtf.NewTextWidget(" 🕗 World Clocks ", "clocks", false), + TextWidget: wtf.NewTextWidget(" World Clocks ", "clocks", false), } widget.clockColl = widget.buildClockCollection(Config.UMap("wtf.mods.clocks.locations")) diff --git a/cmdrunner/widget.go b/cmdrunner/widget.go index bb25dac6..3c80ae5a 100644 --- a/cmdrunner/widget.go +++ b/cmdrunner/widget.go @@ -22,7 +22,7 @@ type Widget struct { func NewWidget() *Widget { widget := Widget{ - TextWidget: wtf.NewTextWidget(" 🏃 Runner ", "cmdrunner", false), + TextWidget: wtf.NewTextWidget(" CmdRunner ", "cmdrunner", false), args: wtf.ToStrs(Config.UList("wtf.mods.cmdrunner.args")), cmd: Config.UString("wtf.mods.cmdrunner.cmd"), diff --git a/cryptoexchanges/cryptolive/widget.go b/cryptoexchanges/cryptolive/widget.go index 4c652104..e59eef96 100644 --- a/cryptoexchanges/cryptolive/widget.go +++ b/cryptoexchanges/cryptolive/widget.go @@ -3,9 +3,8 @@ package cryptolive import ( "encoding/json" "fmt" - "time" - "net/http" + "time" "github.com/olebedev/config" "github.com/senorprogrammer/wtf/wtf" @@ -32,7 +31,7 @@ type Widget struct { func NewWidget() *Widget { started = false widget := Widget{ - TextWidget: wtf.NewTextWidget(" $ CryptoLive ", "cryptolive", false), + TextWidget: wtf.NewTextWidget(" CryptoLive ", "cryptolive", false), updateInterval: Config.UInt("wtf.mods.cryptolive.updateInterval", 10), } @@ -98,7 +97,7 @@ func display(widget *Widget) { toPriceColor = Config.UString("wtf.mods.cryptolive.colors.to.price", "green") ) for _, item := range widget.list.items { - str += fmt.Sprintf("[%s]%s[%s](%s):\n", fromNameColor, item.displayName, fromDisplayNameColor, item.name) + str += fmt.Sprintf(" [%s]%s[%s] (%s)\n", fromNameColor, item.displayName, fromDisplayNameColor, item.name) for _, toItem := range item.to { str += fmt.Sprintf("\t[%s]%s: [%s]%f\n", toNameColor, toItem.name, toPriceColor, toItem.price) } @@ -116,7 +115,7 @@ func getToList(fromName string) []*toCurrency { for _, to := range toNames { toList = append(toList, &toCurrency{ name: to.(string), - price: -1, + price: 0, }) } diff --git a/docs/404.html b/docs/404.html index 4eed2f2b..1d0472f5 100644 --- a/docs/404.html +++ b/docs/404.html @@ -65,6 +65,7 @@ + diff --git a/docs/categories/index.html b/docs/categories/index.html index 263164e0..5fe1e86c 100644 --- a/docs/categories/index.html +++ b/docs/categories/index.html @@ -67,6 +67,7 @@ + diff --git a/docs/css/wtf.css b/docs/css/wtf.css index 88213b04..ea13b9d6 100644 --- a/docs/css/wtf.css +++ b/docs/css/wtf.css @@ -27,6 +27,11 @@ span.caption { text-align: right; } +ul { + line-height: 22px !important; + margin-bottom: 14px !important; +} + .disabled { color: gray !important; cursor: not-allowed; diff --git a/docs/index.html b/docs/index.html index 99ae1e75..ec1f2290 100644 --- a/docs/index.html +++ b/docs/index.html @@ -66,6 +66,7 @@ + diff --git a/docs/index.xml b/docs/index.xml index 2b3ff365..194622a5 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -6,11 +6,29 @@ Recent content on WTF - A Terminal Dashboard Hugo -- gohugo.io en-us - Sat, 02 Jun 2018 05:32:04 -0700 + Sun, 03 Jun 2018 20:06:40 -0700 + + Cryptolive + https://wtfutil.com/posts/modules/cryptocurrencies/cryptolive/ + Sun, 03 Jun 2018 20:06:40 -0700 + + https://wtfutil.com/posts/modules/cryptocurrencies/cryptolive/ + Added in v0.0.5. +Compare crypto currencies using CryptoCompare. +Source Code wtf/cryptocurrencies/cryptolive/ Required ENV Vars None. +Keyboard Commands None. +Configuration cryptolive:colors:from:name:coraldisplayName:greyto:name:whiteprice:greencurrencies:BTC:displayName:Bitcointo:-USD-EUR-ETHETH:displayName:Ethereumto:-USD-EUR-ETHenabled:trueposition:top:5left:2height:1width:2refreshInterval:30updateInterval:15 Attributes colors.from.name Values: Any X11 color name. +colors.from.dispayName Values: Any X11 color name. +colors.to.name Values: Any X11 color name. +colors.to.price Values: Any X11 color name. +currencies 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. + + Prettyweather https://wtfutil.com/posts/modules/prettyweather/ @@ -311,7 +329,7 @@ Widgets are defined by a required widget.go file in a Module. Sun, 15 Apr 2018 21:17:16 -0700 https://wtfutil.com/posts/configuration/ - Configuration Files By default WTF looks in a ~/.wtf/ directory for a YAML file called config.yml. If the ~/.wtf/ directory doesn’t exist, WTF will create that directory on start-up, and then display instructions for creating a new configuration file. + Index Configuration Files Environment (ENV) Variables Grid Layout Configuration Files By default WTF looks in a ~/.wtf/ directory for a YAML file called config.yml. If the ~/.wtf/ directory doesn’t exist, WTF will create that directory on start-up, and then display instructions for creating a new configuration file. In other words, WTF expects to have a YAML config file at: ~/.wtf/config.yml. Example Configuration Files A couple of example config files are provided in the _sample_configs/ directory of the Git repository. diff --git a/docs/posts/configuration/attributes/index.html b/docs/posts/configuration/attributes/index.html index 76a1a2cb..471b05aa 100644 --- a/docs/posts/configuration/attributes/index.html +++ b/docs/posts/configuration/attributes/index.html @@ -65,6 +65,7 @@ + diff --git a/docs/posts/configuration/index.html b/docs/posts/configuration/index.html index ddf6f629..850d8322 100644 --- a/docs/posts/configuration/index.html +++ b/docs/posts/configuration/index.html @@ -65,6 +65,7 @@ + @@ -111,6 +112,14 @@ +

Index

+ + +

Configuration Files

By default WTF looks in a ~/.wtf/ directory for a YAML file called @@ -155,6 +164,32 @@ wouldn’t want to have laying about in the config files.

variable(s) can be found in that module’s “Required ENV Variables” section of the documentation. See OpsGenie for an example.

+

Grid Layout

+ +

WTF uses the Grid layout system from tview to position widgets +onscreen. It’s not immediately obvious how this works, so here’s an +explanation:

+ +

Think of your terminal screen as a matrix of letter positions, say 100 chrs wide and 58 chrs tall.

+ +

Columns breaks up the width of the screen into chunks, each chunk a specified number of characters wide. use

+ +

[10, 10, 10, 10, 10, 10, 10, 10, 10, 10]

+ +

Ten columns that are ten characters wide

+ +

Rows break up the height of the screen into chunks, each chunk a specified number of characters tall. If we wanted to have five rows:

+ +

[10, 10, 10, 10, 18]

+ +

The co-ordinate system starts at top-left and defines how wide and tall a widget is. If we wanted to put a 2-col, 2-row widget in the bottom of the screen, we’d position it at:

+ +
  top: 4     // top starts in the 4th row
+  left: 9    // left starts in the 9th column
+  height: 2  // span down rows 4 & 5 (18 characters in size, total)
+  width: 2   // span across cols 9 & 10 (20 characters in size, total)
+
+