docs: document timer utilities
ci / rust (push) Successful in 45s
ci / lint-yaml (push) Successful in 5s

This commit is contained in:
2026-07-05 02:33:21 +02:00
parent ce35617bbe
commit 1babd404f9
2 changed files with 42 additions and 1 deletions
+3 -1
View File
@@ -46,10 +46,12 @@ Use a temporary config path so local tests do not mutate the user's real config:
```bash ```bash
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
cargo run -- --config "$tmpdir/config.yaml" init cargo run -- --config "$tmpdir/config.yaml" init
cargo run -- --config "$tmpdir/config.yaml" validate
cargo run -- --config "$tmpdir/config.yaml" status
cargo run -- --config "$tmpdir/config.yaml" preview cargo run -- --config "$tmpdir/config.yaml" preview
``` ```
For `run` smoke tests, disable actions first so the command does not call `playerctl`, `systemctl`, `pkill`, workspace tools, or custom shell commands. For `run` smoke tests, pass `--no-actions` or disable actions first so the command does not call `playerctl`, `systemctl`, `pkill`, workspace tools, or custom shell commands.
## Versioning ## Versioning
+39
View File
@@ -60,6 +60,24 @@ Preview commands that will run after the countdown:
gosleep-timer preview gosleep-timer preview
``` ```
Show the current config, enabled actions, and dangerous-action markers:
```bash
gosleep-timer status
```
Validate the config without starting the timer:
```bash
gosleep-timer validate
```
Open the config in `$VISUAL`, `$EDITOR`, or `vi`:
```bash
gosleep-timer edit
```
Run the saved timer config: Run the saved timer config:
```bash ```bash
@@ -73,6 +91,20 @@ gosleep-timer run 45m
gosleep-timer run 1h30m gosleep-timer run 1h30m
``` ```
Run the countdown without executing post-timer actions:
```bash
gosleep-timer run --dry-run 10s
gosleep-timer run --no-actions 10s
```
Inspect recorded sessions and aggregate stats:
```bash
gosleep-timer history
gosleep-timer stats
```
Use a custom config path: Use a custom config path:
```bash ```bash
@@ -89,6 +121,7 @@ gosleep-timer --config ./config.yaml preview
| `Enter` while editing | Apply edit | | `Enter` while editing | Apply edit |
| `Esc` while editing | Cancel edit | | `Esc` while editing | Cancel edit |
| `r` | Start/restart timer | | `r` | Start/restart timer |
| `p` | Pause/resume running timer |
| `x` | Stop timer | | `x` | Stop timer |
| `s` | Save config | | `s` | Save config |
| `q` / `Esc` | Quit | | `q` / `Esc` | Quit |
@@ -154,6 +187,12 @@ Other actions use common Linux desktop tools:
- `systemctl` - `systemctl`
Install only the tools needed for the actions you enable. Install only the tools needed for the actions you enable.
Dangerous actions such as `pkill`, power actions, and common destructive custom commands are highlighted in red in the TUI preview.
## History
Completed timer sessions are appended to `history.yaml` next to the active config file.
If no poweroff or reboot action is configured, CLI `run` asks for wake confirmation after the timer finishes and records the elapsed sleep time.
## Development ## Development