Skip to content

Commit 5550d01

Browse files
committed
stable v1.1.0 - new features: HTTP call + YAML presets & defaults
- Add --url flag to fire HTTP GET on timer finish with response display - Add ~/.dstimer/defaults.yaml for global default settings - Add ~/.dstimer/presets.yaml for named timer configurations (e.g. dstimer pomodoro) - Positional arg now accepts preset names or time values - TUI skips audio/URL prompts when values are prefilled from config - Update README with configuration docs, TOC, and new install methods
1 parent 56751dc commit 5550d01

9 files changed

Lines changed: 438 additions & 45 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- target: x86_64-pc-windows-msvc
3939
runner: windows-latest
40-
asset_name: dstimer-windows-x86_64.exe
40+
asset_name: dstimer.exe
4141

4242
steps:
4343
- uses: actions/checkout@v4
@@ -114,7 +114,7 @@ jobs:
114114
# uses: vedantmgoyal9/winget-releaser@v2
115115
# with:
116116
# identifier: madLinux.dstimer
117-
# installers-regex: 'dstimer-windows-x86_64\.exe$'
117+
# installers-regex: 'dstimer\.exe$'
118118
# token: ${{ secrets.WINGET_TOKEN }}
119119

120120
update-scoop:
@@ -131,16 +131,16 @@ jobs:
131131
- name: Download Windows artifact
132132
uses: actions/download-artifact@v4
133133
with:
134-
name: dstimer-windows-x86_64.exe
134+
name: dstimer.exe
135135
path: artifacts
136136

137137
- name: Update Scoop manifest
138138
run: |
139139
VERSION="${GITHUB_REF_NAME#v}"
140-
SHA256=$(sha256sum artifacts/dstimer-windows-x86_64.exe | cut -d' ' -f1)
140+
SHA256=$(sha256sum artifacts/dstimer.exe | cut -d' ' -f1)
141141
jq --arg v "$VERSION" --arg h "$SHA256" \
142142
'.version = $v |
143-
.architecture."64bit".url = "https://github.com/madLinux7/dead-simple-cli-timer/releases/download/v\($v)/dstimer-windows-x86_64.exe#/dstimer.exe" |
143+
.architecture."64bit".url = "https://github.com/madLinux7/dstimer/releases/download/v\($v)/dstimer.exe" |
144144
.architecture."64bit".hash = $h' \
145145
bucket/dstimer.json > bucket/dstimer.json.tmp && mv bucket/dstimer.json.tmp bucket/dstimer.json
146146

Cargo.lock

Lines changed: 76 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dstimer"
3-
version = "1.0.5"
3+
version = "1.1.0"
44
edition = "2021"
55
description = "A dead-simple, cross-platform CLI countdown timer with color-changing progress bar and optional audio playback"
66
license = "MIT"
@@ -21,6 +21,9 @@ rodio = { version = "0.17", default-features = false, features = [
2121
] }
2222
ctrlc = "3.4"
2323
ureq = "2"
24+
serde = { version = "1", features = ["derive"] }
25+
serde_yaml = "0.9"
26+
dirs = "5"
2427
[target.'cfg(not(target_os = "macos"))'.dependencies]
2528
notify-rust = "4"
2629

README.md

Lines changed: 115 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,42 @@
44
![License](https://img.shields.io/badge/license-MIT-blue)
55
![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey)
66

7-
A dead-simple, cross-platform CLI countdown timer with color-changing progress bar and optional audio playback on finish.
7+
A dead-simple, cross-platform CLI countdown timer featuring:
8+
9+
- Color-changing progress bar
10+
- Fullscreen / Inline mode
11+
- Optional audio playback
12+
- Optional HTTP webhook
13+
- Optional notifications on finish
14+
- YAML-based presets and defaults.
815

916
Written in Rust for maximum efficiency and portability.
1017

11-
![Demo with 7 as argument representing the seconds](demo_args_1.gif)
18+
<p align="center">
19+
<img src="demo_args_1.gif" alt="dssh demo"><br>
20+
<sub>Demo with 7 seconds as argument (Fullscreen)</sub>
21+
</p>
22+
23+
<p align="center">
24+
<img src="demo_pomodoro_yaml.gif" alt="dssh demo"><br>
25+
<sub>Demo with pomodoro preset (Inline)</sub>
26+
</p>
27+
28+
## Table of Contents
29+
30+
- [Features](#features)
31+
- [Usage](#usage)
32+
- [TUI / Interactive mode](#tui--interactive-mode-no-arguments)
33+
- [Fullscreen mode](#fullscreen-mode)
34+
- [Inline mode](#inline-mode---inline---i)
35+
- [Configuration](#configuration)
36+
- [defaults.yaml](#defaultsyaml--global-defaults)
37+
- [presets.yaml](#presetsyaml--named-presets)
38+
- [Install](#install)
39+
- [Supported Audio Formats](#supported-audio-formats)
40+
- [Build from Source](#build-from-source)
41+
- [Contributing](#contributing)
42+
- [Acknowledgements](#-acknowledgements-)
1243

1344
## Features
1445

@@ -17,23 +48,29 @@ Written in Rust for maximum efficiency and portability.
1748
- Full-width **progress bar**: green → yellow → red as time runs out
1849
- Interactive **time entry** (HH:MM:SS) when no arguments parsed
1950
- ♪ Optional **audio file playback** when the timer completes ♪
51+
- Optional **HTTP call** (`--url`) — fires a GET request on finish and shows the response
52+
- **YAML presets** — save named presets (e.g. `dstimer pomodoro`) in `~/.dstimer/presets.yaml`
53+
- **Global defaults** — set default audio, URL, inline/silent in `~/.dstimer/defaults.yaml`
2054

2155
## Usage
2256

2357
| Flag | Short | Description |
2458
|------|-------|-------------|
25-
| `--time` | `-t` | Default argument parsing duration in `HH:MM:SS`, `MM:SS`, or `SS` format |
59+
| `--time` | `-t` | Duration in `HH:MM:SS`, `MM:SS`, or `SS` format |
2660
| `--audio` | `-a` | Path to audio file to play on finish |
61+
| `--url` | `-u` | URL to call (HTTP GET) when timer finishes |
2762
| `--inline` | `-i` | Inline mode (see below) |
2863
| `--silent` | | Suppress desktop notifications |
2964

30-
### **Interactive mode** (no arguments):
65+
The positional argument can be a **time value** (`dstimer 25:00`) or a **preset name** (`dstimer pomodoro`). See [Configuration](#configuration) below.
66+
67+
### **TUI / Interactive mode** (no arguments):
3168

3269
```bash
3370
dstimer
3471
```
3572

36-
You'll be prompted to enter a duration and an optional audio file path.
73+
You'll be prompted to enter a duration, an optional audio file path, and an optional URL.
3774

3875
![demo_manual](demo_manual.gif)
3976

@@ -45,6 +82,9 @@ dstimer 25:00 # 25 minutes
4582
dstimer 7 # 7 seconds
4683
dstimer --time 1:30:17 # 1 hour 30 minutes 17 seconds
4784
dstimer 90 --audio /path/to/audio.wav # plays audio.wav after 90 seconds
85+
dstimer 5:00 --url https://example.com/hook # fires HTTP GET after 5 minutes
86+
dstimer pomodoro # loads named preset
87+
dstimer pomodoro -t 30:00 # preset with CLI time override
4888
```
4989

5090
![Demo with seconds and audio as arguments](demo_args_2.gif)
@@ -62,23 +102,85 @@ Renders the timer on the **current terminal line** instead of taking over the fu
62102
![Demo inline with -i -t 00:00:07 args](demo_inline_args_1.gif)
63103
![Demo inline with -i -t 00:00:07 -a "home/linuxg/Musik/Super Survivor.flac" args](demo_inline_args_2.gif)
64104

65-
## Install
105+
## Configuration
106+
107+
dstimer automatically creates `~/.dstimer/` with two YAML files on first run.
108+
109+
### `defaults.yaml` — Global defaults
110+
111+
These values apply to every run unless overridden by a preset or CLI flags.
112+
113+
```yaml
114+
inline: false
115+
silent: false
116+
audio: ""
117+
url: ""
118+
```
66119
67-
**macOS / Linux:**
120+
When `audio` or `url` are set here, the interactive TUI **skips those prompts** automatically.
121+
122+
### `presets.yaml` — Named presets
123+
124+
Define reusable timer presets and call them by name:
125+
126+
```yaml
127+
pomodoro:
128+
time: "25:00"
129+
inline: true
130+
silent: false
131+
audio: "/home/user/music/bell.flac"
132+
url: "https://example.com/pomodoro-done"
133+
134+
break:
135+
time: "5:00"
136+
silent: true
137+
```
138+
139+
Then just run:
68140

69141
```bash
142+
dstimer pomodoro # uses all preset values, starts immediately
143+
dstimer break # 5-minute silent break timer
144+
dstimer pomodoro -t 30:00 # override just the time
145+
```
146+
147+
All fields in a preset entry are optional. Missing fields fall back to `defaults.yaml`.
148+
149+
**Priority order:** CLI flags > preset > defaults.yaml
150+
151+
## Install
152+
153+
### Linux / macOS Install Script
154+
155+
```sh
70156
curl -fsSL https://raw.githubusercontent.com/madLinux7/dstimer/main/install.sh | sh
71157
```
72158

73-
**Windows (PowerShell):**
159+
### macOS
74160

75-
```powershell
161+
**homebrew**
162+
163+
```sh
164+
brew install madLinux7/tap/dstimer
165+
```
166+
167+
### Windows
168+
169+
**Winget:**
170+
171+
```ps1
172+
winget install madLinux.dstimer
173+
```
174+
175+
**PowerShell Install Script:**
176+
177+
```ps1
76178
irm https://raw.githubusercontent.com/madLinux7/dstimer/main/install.ps1 | iex
77179
```
78180

79-
**Via Cargo (requires Rust):**
181+
### Via Cargo (requires Rust)
80182

81-
```bash
183+
```sh
82184
cargo install dstimer
83185
```
84186

@@ -115,6 +217,8 @@ dstimer couldn't be dead simple without the efforts of some great open-source pr
115217
- [crossterm](https://github.com/crossterm-rs/crossterm) — cross-platform terminal manipulation
116218
- [rodio](https://github.com/RustAudio/rodio) — audio playback
117219
- [Symphonia](https://github.com/pdeljanov/Symphonia) — audio decoding (MP3, FLAC, WAV, OGG, ...)
220+
- [ureq](https://github.com/algesten/ureq) — lightweight HTTP client
221+
- [serde](https://github.com/serde-rs/serde) + [serde_yaml](https://github.com/dtolnay/serde-yaml) — YAML configuration
118222
- [ctrlc](https://github.com/Detegr/rust-ctrlc) — Ctrl+C signal handling
119223
- [notify-rust](https://github.com/hoodie/notify-rust) — desktop notifications on Linux & Windows
120224
- [winresource](https://github.com/mxre/winresource) — embedding the app icon on Windows

demo_pomodoro_yaml.gif

27.9 KB
Loading

0 commit comments

Comments
 (0)