mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
First pass at new site template
This commit is contained in:
committed by
Chris Cummer
parent
215c7e571f
commit
d872a28cf7
87
_site/content/configuration/_index.md
Normal file
87
_site/content/configuration/_index.md
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
title: "Configuration"
|
||||
date: 2018-04-15T21:17:16-07:00
|
||||
draft: false
|
||||
weight: 5
|
||||
---
|
||||
|
||||
## Index
|
||||
|
||||
* [Configuration Files](#configuration-files)
|
||||
* [Environment (ENV) Variables](#environment-env-variables)
|
||||
* [Grid Layout](#grid-layout)
|
||||
|
||||
## Configuration Files
|
||||
|
||||
By default WTF looks in a `~/.config/wtf/` directory for a YAML file called
|
||||
`config.yml`. If the `~/.config/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: `~/.config/wtf/config.yml`.
|
||||
|
||||
#### Example Configuration Files
|
||||
|
||||
A couple of example config files are provided in the `_sample_configs/`
|
||||
directory of the Git repository.
|
||||
|
||||
To try out WTF quickly, copy
|
||||
`simple_config.yml` into `~/.config/wtf/` as `config.yml` and relaunch WTF. You
|
||||
should see the app launch and display the <a href="/posts/modules/security/">Security</a>,
|
||||
<a href="/posts/modules/clocks/">Clocks</a> and <a href="/posts/modules/status/">Status</a> widgets onscreen.
|
||||
|
||||
#### Custom Configuration Files
|
||||
|
||||
To try out different configurations (or run multiple instances of WTF),
|
||||
you can pass the path to a config file via command line arguments on
|
||||
start-up.
|
||||
|
||||
To load a custom configuration file (ie: one that's not
|
||||
`~/.config/wtf/config.yml`), pass in the path to configuration file as a
|
||||
parameter on launch:
|
||||
|
||||
```bash
|
||||
$> wtf --config=path/to/custom/config.yml
|
||||
```
|
||||
|
||||
#### Configuration Attributes
|
||||
|
||||
A number of top-level attributes can be set to customize your WTF
|
||||
install. See <a href="/posts/configuration/attributes/">Attributes</a> for details.
|
||||
|
||||
## Environment (ENV) Variables
|
||||
|
||||
Some modules require the presence of environment variables to function
|
||||
properly. Usually these are API keys or other sensitive data that one
|
||||
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 <a href="/posts/modules/opsgenie/">OpsGenie</a> 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)
|
||||
```
|
||||
85
_site/content/configuration/attributes.md
Normal file
85
_site/content/configuration/attributes.md
Normal file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
title: "Attributes"
|
||||
date: 2018-05-16T21:51:23-07:00
|
||||
draft: false
|
||||
weight: 5
|
||||
---
|
||||
|
||||
The following top-level attributes are configurable in `config.yml`.
|
||||
See this <a href="https://github.com/senorprogrammer/wtf/blob/master/_sample_configs/simple_config.yml">example config file</a> for more details.
|
||||
|
||||
```yaml
|
||||
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 wide
|
||||
columns: [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 four
|
||||
rows: [10, 10, 10, 10, 10, 3, 4]
|
||||
openFileUtil: open # the name of the utility to call to open files
|
||||
refreshInterval: 1 # the app refreshes once per second
|
||||
term: "xterm-256color"
|
||||
```
|
||||
|
||||
### Attributes
|
||||
|
||||
`colors.background` <br />
|
||||
The color to draw the background of the app in. Use this to match your
|
||||
terminal colors. May be over-written by individual module
|
||||
configurations. <br />
|
||||
Values: Any <a href="https://en.wikipedia.org/wiki/X11_color_names">X11
|
||||
color name</a>.
|
||||
|
||||
`colors.border.focusable` <br />
|
||||
The color in which to draw the border of widgets that can accept
|
||||
keyboard focus. <br />
|
||||
Values: Any <a href="https://en.wikipedia.org/wiki/X11_color_names">X11
|
||||
color name</a>.
|
||||
|
||||
`colors.border.focused` <br />
|
||||
The color in which to draw the border of the widget that currently has
|
||||
keyboard focus. <br />
|
||||
Values: Any <a href="https://en.wikipedia.org/wiki/X11_color_names">X11
|
||||
color name</a>.
|
||||
|
||||
`colors.border.normal` <br />
|
||||
The color in which to draw the borders of the widgets that cannot accept
|
||||
focus. <br/>
|
||||
Values: Any <a href="https://en.wikipedia.org/wiki/X11_color_names">X11
|
||||
color name</a>.
|
||||
|
||||
`grid.columns` <br />
|
||||
An array that defines the widths of all the columns. <br />
|
||||
Values: See <a href="https://github.com/rivo/tview/wiki/Grid">tview's
|
||||
Grid</a> for details.
|
||||
|
||||
`grid.rows` <br />
|
||||
An array that defines the heights of all the rows. <br />
|
||||
Values: See <a href="https://github.com/rivo/tview/wiki/Grid">tview's
|
||||
Grid</a> for details.
|
||||
|
||||
`openFileUtil` <br />
|
||||
Command to use to open a file or URL
|
||||
|
||||
`refreshInterval` <br />
|
||||
How often, in seconds, the UI refreshes itself. <br />
|
||||
**Note:** This implementation is probably wrong and buggy and likely to
|
||||
change. <br />
|
||||
Values: A positive integer, `0..n`.
|
||||
|
||||
`term` <br />
|
||||
_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 />
|
||||
Values: Any valid terminal type (ie: vt100, xterm, xterm-256color, ansi,
|
||||
etc.).
|
||||
28
_site/content/configuration/iterm2.md
Normal file
28
_site/content/configuration/iterm2.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: "iTerm2"
|
||||
date: 2018-05-24T09:57:40-07:00
|
||||
draft: false
|
||||
weight: 10
|
||||
---
|
||||
|
||||
Many terminal apps don't properly display multibyte emoji characters
|
||||
properly. This **may** fix the issue for you in iTerm2, it also may not.
|
||||
|
||||
By default iTerm2 uses a unicode rendering format
|
||||
that is not comletely compatible with some emoji characters. Instead what you'll
|
||||
see is the emoji over-lapping normal text characters, or drawing outside
|
||||
the bounds of where they should be.
|
||||
|
||||
In iTerm2 open:
|
||||
|
||||
```bash
|
||||
Preferences -> Profiles -> Text
|
||||
```
|
||||
and check **on** the "Use Unicode Version 9 Widths" checkbox. Then
|
||||
restart WTF.
|
||||
|
||||
<img src="/imgs/iterm2prefs.png" width="800" height="437" alt="iTerm2
|
||||
Prefs" />
|
||||
|
||||
(*Note:* This issue is not unique to iTerm2. As of this writing it also
|
||||
affects <a href="https://en.wikipedia.org/wiki/Terminal_(macOS)">Terminal</a>, and <a href="https://hyper.is">Hyper</a>.)
|
||||
Reference in New Issue
Block a user