1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge branch 'master' into cryptolive

This commit is contained in:
jeangovil 2018-06-02 21:10:08 +04:30 committed by GitHub
commit 0c6aaa4d2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 434 additions and 105 deletions

21
.editorconfig Normal file
View File

@ -0,0 +1,21 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
max_line_length=120
[*.go]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
[*.html]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = false
[*.md]
trim_trailing_whitespace = false

19
.gitignore vendored
View File

@ -1,2 +1,21 @@
### Go ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Misc
.DS_Store
gcal/client_secret.json
#intellij idea
.idea/
dist/*

View File

@ -72,7 +72,8 @@ change. <br />
Values: A positive integer, `0..n`.
`term` <br />
This value is _optional_. Sets a custom value for the terminal type this app runs in. Leave this entry out of the config if you simply want to use your terminal's
_Optional_. <br />
Sets a custom value for the terminal type this app runs in. Leave this entry out of the config if you simply want to use your terminal's
default setting. <br />
**Note:** If an invalid value is provided for this setting, the app will
crash with a `"terminal entry not found"` error. <br />

View File

@ -6,6 +6,8 @@ draft: false
Displays your current IP address information, from ipinfo.io.
<img src="/imgs/modules/ipinfo.png" width="320" height="199" alt="ipinfo screenshot" />
## Source Code
```bash

View File

@ -0,0 +1,64 @@
---
title: "Prettyweather"
date: 2018-06-02T05:32:04-07:00
draft: false
---
**🔬 Experimental**
Displays weather information as ASCII art from
[Wttr.in](http://wttr.in).
<img src="/imgs/modules/prettyweather.png" width="320" height="191" alt="prettyweather screenshot" />
## Source Code
```bash
wtf/prettyweather/
```
## Required ENV Variables
None.
## Keyboard Commands
None.
## Configuration
```yaml
prettyweather:
enabled: true
city: "tehran"
position:
top: 3
left: 5
height: 1
width: 1
refreshInterval: 300
unit: "c"
```
### Attributes
`city` <br />
_Optional_. It will grab the current location from your IP address if
omitted.<br />
Values: The name of any city supported by [Wttr.in](http://wttr.in).
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.
`position` <br />
Defines where in the grid this module's widget will be displayed. <br />
`refreshInterval` <br />
How often, in seconds, this module will update its data. <br />
Values: A positive integer, `0..n`.
`unit` <br />
_Optional_. It will use metric if you are out of US and imperial for US.<br />
The temperature scale in which to display temperature values. <br />
Values: `F` for Fahrenheit, `C` for Celcius.

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -33,6 +33,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

23
dist/CHANGELOG.md vendored
View File

@ -1,23 +0,0 @@
## Changelog
f23ac85 Fixes bug with default configuration YAML
3e004fd Fix a speling mistake in the documentation
641dce9 Add Configuration and Keyboard Commands to Overview documentation.
ff49ecb Closes #29. wtf.go --help [module name] returns help text if any is available.
9e9ef93 Update the readme
38cf1d5 Security module now displays logged-in users
efaccc8 Added Overview page to documentation
5d66b2a Improve the state of the Makefile a bit
ca4d6f2 Add 'make dependencies' to the Makefile
cd5a796 Fix bug with positioning in which I hard-coded the positions because....?
374832f Update the readme
ca81908 Add dramatic marketing emphasis to site homepage
216a313 Clean up the site sideabar
8bb9115 A very basic start to adding some unit tests
c190a44 Updated the screenshot to show all the modules
e2c27ab Add installation instructions to documentation
ca7d867 h2 styling in the site
0d1c9ca Add documentation for CmdRunner
a62b910 Closes #43. Add CommandRunner module to the app.
c3f1402 WIP
a6dce55 Update the doc site

73
dist/config.yaml vendored
View File

@ -1,73 +0,0 @@
project_name: wtf
release:
github:
owner: senorprogrammer
name: wtf
name_template: '{{.Tag}}'
brew:
name: wtf
commit_author:
name: goreleaserbot
email: goreleaser@carlosbecker.com
install: bin.install "wtf"
scoop:
commit_author:
name: goreleaserbot
email: goreleaser@carlosbecker.com
builds:
- goos:
- darwin
- linux
goarch:
- amd64
goarm:
- "6"
targets:
- darwin_amd64
- linux_amd64
main: .
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
binary: wtf
lang: go
archive:
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm
}}v{{ .Arm }}{{ end }}'
format: tar.gz
files:
- licence*
- LICENCE*
- license*
- LICENSE*
- readme*
- README*
- changelog*
- CHANGELOG*
nfpm:
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm
}}v{{ .Arm }}{{ end }}'
bindir: /usr/local/bin
snapcraft:
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm
}}v{{ .Arm }}{{ end }}'
snapshot:
name_template: SNAPSHOT-{{ .Commit }}
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
dist: dist
sign:
cmd: gpg
args:
- --output
- $signature
- --detach-sig
- $artifact
signature: ${artifact}.sig
artifacts: none
env_files:
github_token: ~/.config/goreleaser/github_token
before:
hooks:
- make install
github_urls:
download: https://github.com

BIN
dist/darwin_amd64/wtf vendored

Binary file not shown.

BIN
dist/linux_amd64/wtf vendored

Binary file not shown.

View File

@ -1,2 +0,0 @@
0167b691f57126d3a5cd6ffb4a6ba6115a9b3c5a48541db370530761400b9a21 wtf_0.0.3_linux_amd64.tar.gz
9905629c87fef6c3483bbdd1f8fcf69f4821da9aa80f05b22a8162a063c7905f wtf_0.0.3_darwin_amd64.tar.gz

Binary file not shown.

Binary file not shown.

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -76,6 +76,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -75,6 +75,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -6,11 +6,27 @@
<description>Recent content on WTF - A Terminal Dashboard</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Fri, 01 Jun 2018 23:18:48 -0700</lastBuildDate>
<lastBuildDate>Sat, 02 Jun 2018 05:32:04 -0700</lastBuildDate>
<atom:link href="https://wtfutil.com/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Prettyweather</title>
<link>https://wtfutil.com/posts/modules/prettyweather/</link>
<pubDate>Sat, 02 Jun 2018 05:32:04 -0700</pubDate>
<guid>https://wtfutil.com/posts/modules/prettyweather/</guid>
<description>🔬 Experimental
Displays weather information as ASCII art from Wttr.in.
Source Code wtf/prettyweather/ Required ENV Variables None.
Keyboard Commands None.
Configuration prettyweather:enabled:truecity:&amp;#34;tehran&amp;#34;position:top:3left:5height:1width:1refreshInterval:300unit:&amp;#34;c&amp;#34; 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&amp;rsquo;s widget will be displayed.</description>
</item>
<item>
<title>Module: IPInfo</title>
<link>https://wtfutil.com/posts/modules/ipinfo/</link>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
@ -174,7 +175,8 @@ change. <br />
Values: A positive integer, <code>0..n</code>.</p>
<p><code>term</code> <br />
This value is <em>optional</em>. Sets a custom value for the terminal type this app runs in. Leave this entry out of the config if you simply want to use your terminal&rsquo;s
<em>Optional</em>. <br />
Sets a custom value for the terminal type this app runs in. Leave this entry out of the config if you simply want to use your terminal&rsquo;s
default setting. <br />
<strong>Note:</strong> If an invalid value is provided for this setting, the app will
crash with a <code>&quot;terminal entry not found&quot;</code> error. <br />

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -76,6 +76,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
@ -96,6 +97,13 @@
<h1 class="title">Posts</h1>
<ul class="posts">
<li>
<span>
<a href="https://wtfutil.com/posts/modules/prettyweather/">Prettyweather</a>
<time class="pull-right post-list">Jun 02, 2018</time>
</span>
</li><li>
<span>
<a href="https://wtfutil.com/posts/modules/ipinfo/">Module: IPInfo</a>

View File

@ -6,11 +6,27 @@
<description>Recent content in Posts on WTF - A Terminal Dashboard</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Fri, 01 Jun 2018 23:18:48 -0700</lastBuildDate>
<lastBuildDate>Sat, 02 Jun 2018 05:32:04 -0700</lastBuildDate>
<atom:link href="https://wtfutil.com/posts/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Prettyweather</title>
<link>https://wtfutil.com/posts/modules/prettyweather/</link>
<pubDate>Sat, 02 Jun 2018 05:32:04 -0700</pubDate>
<guid>https://wtfutil.com/posts/modules/prettyweather/</guid>
<description>🔬 Experimental
Displays weather information as ASCII art from Wttr.in.
Source Code wtf/prettyweather/ Required ENV Variables None.
Keyboard Commands None.
Configuration prettyweather:enabled:truecity:&amp;#34;tehran&amp;#34;position:top:3left:5height:1width:1refreshInterval:300unit:&amp;#34;c&amp;#34; 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&amp;rsquo;s widget will be displayed.</description>
</item>
<item>
<title>Module: IPInfo</title>
<link>https://wtfutil.com/posts/modules/ipinfo/</link>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
@ -112,6 +113,8 @@
<p>Displays your current IP address information, from ipinfo.io.</p>
<p><img src="/imgs/modules/ipinfo.png" width="320" height="199" alt="ipinfo screenshot" /></p>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/ipinfo/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -0,0 +1,176 @@
<!DOCTYPE html>
<html lang="en-us" class="wf-firasans-n4-active wf-active">
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Enable responsiveness on mobile devices -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="generator" content="Hugo 0.38.2" />
<title>Prettyweather | WTF - A Terminal Dashboard</title>
<meta content="Prettyweather - WTF - A Terminal Dashboard" property="og:title">
<meta content=" - " property="og:description">
<!-- CSS -->
<link rel="stylesheet" href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:300,300i,400,400i|Roboto+Mono:300,300i,400,400i" rel="stylesheet">
<link rel="stylesheet" href="https://wtfutil.com/css/print.css" media="print">
<link rel="stylesheet" href="https://wtfutil.com/css/poole.css">
<link rel="stylesheet" href="https://wtfutil.com/css/hyde.css">
<link rel="stylesheet" href="https://wtfutil.com/css/syntax.css">
<link rel="stylesheet" href="https://wtfutil.com/css/wtf.css">
<!-- Font-Awesome -->
<script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js" integrity="sha384-8iPTk2s/jMVj81dnzb/iFR2sdA7u06vHJyyLlAd4snFpCl/SnyUjRrbdJsw1pGIl" crossorigin="anonymous"></script>
<!-- Customised CSS -->
<link rel="stylesheet" href="https://wtfutil.com/css/custom.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="/favicon.png">
<script async defer src="https://buttons.github.io/buttons.js"></script>
</head>
<body>
<div class="sidebar">
<div class="container">
<div class="sidebar-about text-center">
<a href="https://wtfutil.com/"> <img src="/img/wtf.png" alt="WFT Logo" class="" width=""> </a>
<p class="lead">
</p>
</div>
<div>
<h3 style="color: white;">Content</h3>
<ul style="list-style-type: none;">
<li class="sidebar-list-item-1"><a href="/posts/overview/">Overview</a></li>
<li class="sidebar-list-item-1"><a href="/posts/installation/">Installation</a></li>
<li class="sidebar-list-item-1"><a href="/posts/configuration/">Configuration</a></li>
<li class="sidebar-list-item-2"><a href="/posts/configuration/attributes/">Attributes</a></li>
<li class="sidebar-list-item-2"><a href="/posts/configuration/iterm2/">iTerm2</a></li>
<li class="sidebar-list-item-1"><a href="https://github.com/senorprogrammer/wtf/releases">Releases</a></li>
</ul>
<ul style="list-style-type: none;">
<li class="sidebar-list-item-1"><a href="/posts/modules/">Modules</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/bamboohr/">BambooHR</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/clocks/">Clocks</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/cmdrunner/">CmdRunner</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/git/">Git</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/github/">Github</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/gcal/">Google Calendar</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/ipinfo/">IPInfo</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/jira/">Jira</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
</ul>
</div>
<p class="copyright">
&copy; 2018 Chris Cummer.
<br />
<a href="https://creativecommons.org/licenses/by/4.0">Some Rights Reserved</a>.
</p>
</div>
</div>
<div class="content container">
<div class="post">
<h1>Prettyweather</h1>
<div class="col-sm-12 col-md-12">
<span class="text-left post-date meta">
Jun 02, 2018
<br/>
</span>
</div>
<p><strong>🔬 Experimental</strong></p>
<p>Displays weather information as ASCII art from
<a href="http://wttr.in">Wttr.in</a>.</p>
<p><img src="/imgs/modules/prettyweather.png" width="320" height="191" alt="prettyweather screenshot" /></p>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/prettyweather/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p>None.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p>None.</p>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="w"> </span>prettyweather<span class="p">:</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>city<span class="p">:</span><span class="w"> </span><span class="s2">&#34;tehran&#34;</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">3</span><span class="w">
</span><span class="w"> </span>left<span class="p">:</span><span class="w"> </span><span class="m">5</span><span class="w">
</span><span class="w"> </span>height<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span><span class="w"> </span>width<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">300</span><span class="w">
</span><span class="w"> </span>unit<span class="p">:</span><span class="w"> </span><span class="s2">&#34;c&#34;</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>city</code> <br />
<em>Optional</em>. It will grab the current location from your IP address if
omitted.<br />
Values: The name of any city supported by <a href="http://wttr.in">Wttr.in</a>.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>
<p><code>position</code> <br />
Defines where in the grid this module&rsquo;s widget will be displayed. <br /></p>
<p><code>refreshInterval</code> <br />
How often, in seconds, this module will update its data. <br />
Values: A positive integer, <code>0..n</code>.</p>
<p><code>unit</code> <br />
<em>Optional</em>. It will use metric if you are out of US and imperial for US.<br />
The temperature scale in which to display temperature values. <br />
Values: <code>F</code> for Fahrenheit, <code>C</code> for Celcius.</p>
</div>
<div class="footer">
</div>
</div>
</body>
</html>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -74,6 +74,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

View File

@ -2,6 +2,11 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://wtfutil.com/posts/modules/prettyweather/</loc>
<lastmod>2018-06-02T05:32:04-07:00</lastmod>
</url>
<url>
<loc>https://wtfutil.com/posts/modules/ipinfo/</loc>
<lastmod>2018-06-01T23:18:48-07:00</lastmod>
@ -119,7 +124,7 @@
<url>
<loc>https://wtfutil.com/posts/</loc>
<lastmod>2018-06-01T23:18:48-07:00</lastmod>
<lastmod>2018-06-02T05:32:04-07:00</lastmod>
<priority>0</priority>
</url>
@ -130,7 +135,7 @@
<url>
<loc>https://wtfutil.com/</loc>
<lastmod>2018-06-01T23:18:48-07:00</lastmod>
<lastmod>2018-06-02T05:32:04-07:00</lastmod>
<priority>0</priority>
</url>

View File

@ -76,6 +76,7 @@
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather <span title="experimental">🔬</span></a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>

66
prettyweather/widget.go Normal file
View File

@ -0,0 +1,66 @@
package prettyweather
import (
"fmt"
"github.com/olebedev/config"
"github.com/senorprogrammer/wtf/wtf"
"io/ioutil"
"net/http"
"strings"
)
// Config is a pointer to the global config object
var Config *config.Config
type Widget struct {
wtf.TextWidget
result string
unit string
city string
}
func NewWidget() *Widget {
widget := Widget{
TextWidget: wtf.NewTextWidget("Pretty Weather", "prettyweather", false),
}
return &widget
}
func (widget *Widget) Refresh() {
if widget.Disabled() {
return
}
widget.UpdateRefreshedAt()
widget.prettyWeather()
widget.View.Clear()
widget.View.SetTitle(fmt.Sprintf(" %s ", widget.Name))
fmt.Fprintf(widget.View, "%s", widget.result)
}
//this method reads the config and calls wttr.in for pretty weather
func (widget *Widget) prettyWeather() {
client := &http.Client{}
widget.unit, widget.city = Config.UString("wtf.mods.prettyweather.unit", "m"), Config.UString("wtf.mods.prettyweather.city", "")
req, err := http.NewRequest("GET", "https://wttr.in/"+widget.city+"?0"+"?"+widget.unit, nil)
if err != nil {
widget.result = fmt.Sprintf("%s", err.Error())
return
}
req.Header.Set("User-Agent", "curl")
response, err := client.Do(req)
if err != nil {
widget.result = fmt.Sprintf("%s", err.Error())
return
}
defer response.Body.Close()
contents, err := ioutil.ReadAll(response.Body)
if err != nil {
widget.result = fmt.Sprintf("%s", err.Error())
return
}
widget.result = fmt.Sprintf("%s", strings.TrimSpace(string(contents)))
}

5
wtf.go
View File

@ -18,10 +18,12 @@ import (
"github.com/senorprogrammer/wtf/git"
"github.com/senorprogrammer/wtf/github"
"github.com/senorprogrammer/wtf/help"
"github.com/senorprogrammer/wtf/ipinfo"
"github.com/senorprogrammer/wtf/jira"
"github.com/senorprogrammer/wtf/newrelic"
"github.com/senorprogrammer/wtf/opsgenie"
"github.com/senorprogrammer/wtf/power"
"github.com/senorprogrammer/wtf/prettyweather"
"github.com/senorprogrammer/wtf/security"
"github.com/senorprogrammer/wtf/status"
"github.com/senorprogrammer/wtf/system"
@ -29,7 +31,6 @@ import (
"github.com/senorprogrammer/wtf/todo"
"github.com/senorprogrammer/wtf/weather"
"github.com/senorprogrammer/wtf/wtf"
"github.com/senorprogrammer/wtf/ipinfo"
)
/* -------------------- Functions -------------------- */
@ -171,6 +172,7 @@ func makeWidgets(app *tview.Application, pages *tview.Pages) {
textfile.Config = Config
todo.Config = Config
weather.Config = Config
prettyweather.Config = Config
wtf.Config = Config
cryptolive.Config = Config
@ -193,6 +195,7 @@ func makeWidgets(app *tview.Application, pages *tview.Pages) {
todo.NewWidget(app, pages),
weather.NewWidget(app, pages),
cryptolive.NewWidget(),
prettyweather.NewWidget(),
}
FocusTracker = wtf.FocusTracker{