Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lunarphase with keyboard controls, add custom keyboard snippets #169

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 95 additions & 3 deletions docs/modules/lunarphase.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
# Lunar Phase

Displays the phase of the Moon as ASCII art from [Wttr.in](http://wttr.in). The width of the column in which the lunar phase is displayed needs to be large enough for the ASCII graphic to fit or multiple columns must be allocated.
Displays the phase of the Moon as ASCII art from [Wttr.in](http://wttr.in).

## Configuration

```yaml
lunarphase:
enabled: true
language: 'en'
position:
top: 3
left: 5
height: 2
width: 2
language: 'en'
refreshInterval: 5h
title: 'Phase of the Moon'
timeout: 30
```

The width of the column in which the lunar phase is displayed needs to be
large enough for the ASCII graphic to fit or multiple columns must be allocated.
For example:

```yaml
grid:
columns: [74, 12]
rows: [14, 14]
```

The default `wtf` settings for opening a URL in a browser on Linux is
to open the URL with `xdg-open`. However, `xdg-open` depends on the KDE
`konqueror` web browser on many systems. An alternate configuration on Linux
systems where `xdg-open` fails or is unavailable may be necessary. One such
configuration uses the Gnome `gio` utility. To use `gio` to open URLs, add
the following to your `wtf` YAML configuration:

```yaml
openUrlUtil:
- 'gio'
- 'open'
```

## Screenshots
Expand All @@ -23,5 +47,73 @@ lunarphase:
<img class="screenshot" src="/assets/modules/lunarphase-fr.png" width="640" height="448" alt="lunarphase french screenshot" />
</p>

## Keyboard

To use module keyboard controls, first press the number of the module
displayed in the title of the module widget to give focus to that module.
To leave module keyboard control mode, press `Esc`.

When using keyboard controls to change the lunar phase day, the
`lunarphase` module widget title will be updated to reflect the currently
configured lunar phase day but the module widget will not automatically refresh.
After selecting the desired day using keyboard controls, refresh the module
widget by pressing `r`. For example, to display next week's lunar phase,
press `Up Arrow` or `N` then press `r`. To view the lunar phase 2 days
previous to the current day, press `Left Arrow` or `p` twice then press `r`.

The following keyboard controls are supported in the `lunarphase` module:

<table>
{% include "keyboard/table_header.md" %}

<tbody>
{% include "keyboard/foreslash.md" %}

{% set return="Open selected day lunar phase at nineplanets.org in the browser" %}
{% include "keyboard/return.md" %}

{% include "keyboard/spacer.md" %}

{% set n="Display next day lunar phase" %}
{% include "keyboard/n.md" %}

{% set p="Display previous day lunar phase" %}
{% include "keyboard/p.md" %}

{% set t="Display today's lunar phase" %}
{% include "keyboard/t.md" %}

{% set N="Display next week lunar phase" %}
{% include "keyboard/N.md" %}

{% set P="Display previous week lunar phase" %}
{% include "keyboard/P.md" %}

{% set o="Open selected day lunar phase at nineplanets.org in the browser" %}
{% include "keyboard/o.md" %}

{% include "keyboard/r.md" %}

{% include "keyboard/spacer.md" %}

{% set arrowBack="Show the previous day lunar phase" %}
{% include "keyboard/arrowBack.md" %}

{% set arrowFore="Show the next day lunar phase" %}
{% include "keyboard/arrowFore.md" %}

{% set customArrowDown="Show previous week lunar phase" %}
{% include "keyboard/customArrowDown.md" %}

{% set customArrowUp="Show next week lunar phase" %}
{% include "keyboard/customArrowUp.md" %}

{% include "keyboard/spacer.md" %}

{% set customCtrlD="Toggle disable/enable widget display" %}
{% include "keyboard/customCtrlD.md" %}
</tbody>
</table>

{% set src="lunarphase" %}
{% include "src_path.md" %}
Binary file modified docs/overrides/assets/modules/lunarphase-fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/overrides/assets/modules/lunarphase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions snippets/keyboard/N.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<tr>
<td><code>N</code></td>
<td>{{ N }}</td>
</tr>
4 changes: 4 additions & 0 deletions snippets/keyboard/P.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<tr>
<td><code>P</code></td>
<td>{{ P }}</td>
</tr>
10 changes: 5 additions & 5 deletions snippets/keyboard/arrowBack.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tr>
<td>
<code>←</code>
</td>
<td>{{ arrowback }}{{ arrowBack }}</td>
</tr>
<td>
<code>←</code>
</td>
<td>{{ arrowBack }}</td>
</tr>
10 changes: 5 additions & 5 deletions snippets/keyboard/arrowFore.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tr>
<td>
<code>→</code>
</td>
<td>{{ arrowfore }}{{ arrowFore }}</td>
</tr>
<td>
<code>→</code>
</td>
<td>{{ arrowFore }}</td>
</tr>
4 changes: 4 additions & 0 deletions snippets/keyboard/customArrowDown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<tr>
<td><code>↓</code></td>
<td>{{ customArrowDown }}</td>
</tr>
4 changes: 4 additions & 0 deletions snippets/keyboard/customArrowUp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<tr>
<td><code>↑</code></td>
<td>{{ customArrowUp }}</td>
</tr>
4 changes: 4 additions & 0 deletions snippets/keyboard/customCtrlD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<tr>
<td><code>Ctrl-d</code></td>
<td>{{ customCtrlD }}</td>
</tr>