Compare commits

..

No commits in common. "main" and "v1.6.0" have entirely different histories.
main ... v1.6.0

43 changed files with 184 additions and 171 deletions

View File

@ -1,21 +1,5 @@
# Changelog
## [unreleased]
### Misc.
- (deps) Rust 1.91.0 [#140](https://github.com/sectore/timr-tui/pull/140)
## v1.6.1 - 2025-10-29
### Fix
- (event) Ignore all key events except `KeyEventKind::Press` [#137](https://github.com/sectore/timr-tui/issues/137)
### Misc.
- (docs) Update all demos [#135](https://github.com/sectore/timr-tui/pull/135), [513f1fe](https://github.com/sectore/timr-tui/commit/513f1fec11ab8bdad46ca565b0c3f08ed37d6219)
## v1.6.0 - 2025-10-16
### Features

2
Cargo.lock generated
View File

@ -2090,7 +2090,7 @@ dependencies = [
[[package]]
name = "timr-tui"
version = "1.6.1"
version = "1.6.0"
dependencies = [
"clap",
"color-eyre",

View File

@ -1,10 +1,10 @@
[package]
name = "timr-tui"
version = "1.6.1"
version = "1.6.0"
description = "TUI to organize your time: Pomodoro, Countdown, Timer."
edition = "2024"
# Reminder: Always keep `channel` in `rust-toolchain.toml` in sync with `rust-version`.
rust-version = "1.91.0"
rust-version = "1.90.0"
homepage = "https://github.com/sectore/timr-tui"
repository = "https://github.com/sectore/timr-tui"
readme = "README.md"

View File

@ -37,13 +37,19 @@ _(theme depends on your terminal preferences)_
<img alt="pomodoro" src="demo/timer.gif" />
</a>
## Countdown (*incl. [Mission Elapsed Time](https://en.wikipedia.org/wiki/Mission_Elapsed_Time)*)
## Countdown
<a href="demo/countdown.gif">
<img alt="countdown" src="demo/countdown.gif" />
</a>
## Event (*past/future*)
## Countdown: Mission Elapsed Time ([MET](https://en.wikipedia.org/wiki/Mission_Elapsed_Time))
<a href="demo/countdown-met.gif">
<img alt="Countdown: Mission Elapsed Time" src="demo/countdown-met.gif" />
</a>
## Event (past/future)
<a href="demo/event.gif">
<img alt="event" src="demo/event.gif" />
@ -55,7 +61,7 @@ _(theme depends on your terminal preferences)_
<img alt="local time" src="demo/local-time.gif" />
</a>
## Local time (*footer*)
## Local time (footer)
<a href="demo/local-time-footer.gif">
<img alt="local time at footer" src="demo/local-time-footer.gif" />
@ -67,13 +73,6 @@ _(theme depends on your terminal preferences)_
<img alt="deciseconds" src="demo/decis.gif" />
</a>
## Maximum (*`9999y`* *`364d`* *`23:59:59.9`*)
<a href="demo/timer-max.png">
<img alt="maximum" src="demo/timer-max.png" />
</a>
## Change style
<a href="demo/style.gif">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -4,8 +4,8 @@ Output demo/blink.gif
Set Theme "nord-light"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

BIN
demo/countdown-met.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

22
demo/countdown-met.tape Normal file
View File

@ -0,0 +1,22 @@
Output demo/countdown-met.gif
# https://github.com/charmbracelet/vhs/blob/main/THEMES.md
Set Theme "iceberg-light"
Set FontSize 14
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
# --- START ---
Set LoopOffset 4
Hide
Type "cargo run -- -m c -c 3"
Enter
Sleep 0.2
Show
Type "s"
Sleep 6
Type "r"
Sleep 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,20 @@
Output demo/countdown-target-future.gif
# https://github.com/charmbracelet/vhs/blob/main/THEMES.md
Set Theme "SeaShells"
Set FontSize 14
Set Width 1000
Set Height 500
Set Padding 0
Set Margin 1
# --- START ---
Set LoopOffset 4
Hide
Type "cargo run -- -r -m c --ct '2030-01-10 18:00'"
Enter
Type "m"
Sleep 0.2
Show
Sleep 0.1

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,20 @@
Output demo/countdown-target-past.gif
# https://github.com/charmbracelet/vhs/blob/main/THEMES.md
Set Theme "seoulbones_light"
Set FontSize 14
Set Width 1000
Set Height 500
Set Padding 0
Set Margin 1
# --- START ---
Set LoopOffset 4
Hide
Type "cargo run -- -r -m c --ct '2024-01-10 18:00'"
Enter
Type "m"
Sleep 0.2
Show
Sleep 0.1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -1,24 +1,23 @@
Output demo/countdown.gif
# https://github.com/charmbracelet/vhs/blob/main/THEMES.md
Set Theme "iceberg-light"
Set Theme "Builtin Solarized Light"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
# --- START ---
Set LoopOffset 4
Hide
Type "cargo run -- -r -d -c 10:00"
Type "cargo run -- -r -d -m c"
Enter
Sleep .2
Type "m" # hide menu
Sleep 0.2
Show
# --- COUNTDOWN ---
Sleep .5
Sleep 1
Type "s"
Sleep 1.4
Type "s"
@ -29,5 +28,6 @@ Type "e"
Sleep 0.1
Down@10ms 65
Sleep 0.1
Type "s"
Type "e"
Sleep 0.1
Sleep 3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -4,8 +4,8 @@ Output demo/decis.gif
Set Theme "nord-light"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
@ -14,8 +14,7 @@ Set LoopOffset 4
Hide
Type "cargo run -- -r -m t"
Enter
Sleep .2
Type "m" # hide menu
Sleep 0.2
Show
# --- STYLES ---
Type "s"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -4,8 +4,8 @@ Output demo/event.gif
Set Theme "Builtin Solarized Dark"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1

BIN
demo/local-time-date.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,6 +1,7 @@
Output demo/local-time-date.gif
# https://github.com/charmbracelet/vhs/blob/main/THEMES.md
Set Theme "Retro"
Set Theme "WarmNeon"
Set FontSize 14
Set Width 1000
@ -9,11 +10,11 @@ Set Padding 0
Set Margin 1
# --- START ---
Type 'cargo run -- -r -d -c "10000y"'
Set LoopOffset 4
Hide
Type "cargo run -- -r -m l"
Enter
Sleep .2
Type "m"
# --- SCREENSHOT ---
Sleep 1s
Screenshot demo/countdown-max.png
Sleep 1s
Sleep 0.2
Show
Sleep 0.1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -4,18 +4,17 @@ Output demo/local-time-footer.gif
Set Theme "AtomOneLight"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
# --- START ---
Set LoopOffset 4
Hide
Type "cargo run -- -r -m c"
Type "cargo run -- -m c"
Enter
Sleep 0.2
Type "m" # hide menu
Show
# --- toggle local time ---
Type@1s ":::"
Type@1.5s ":::"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -4,8 +4,8 @@ Output demo/local-time.gif
Set Theme "Atom"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
@ -14,8 +14,7 @@ Set LoopOffset 4
Hide
Type "cargo run -- -m l"
Enter
Sleep .2
Type "m" # hide menu
Sleep 0.2
Show
# --- toggle local time ---
Type@1s ":::"
Type@1.5s ":::"

BIN
demo/maximum.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

41
demo/maximum.tape Normal file
View File

@ -0,0 +1,41 @@
Output demo/maximum.gif
# https://github.com/charmbracelet/vhs/blob/main/THEMES.md
Set Theme "C64"
Set FontSize 14
Set Width 1000
Set Height 500
Set Padding 0
Set Margin 1
# --- START ---
Set LoopOffset 4
Hide
Type "cargo run -- -r -m timer"
Enter
Sleep 0.2
Type "m"
Type "e"
# secs
Up@1ms 60
Left
# mins
Up@1ms 59
Left
# hours
Up@1ms 23
Left
# days
Up@1ms 364
Right@1ms 3
Down@1ms 1
Left@1ms 4
# years
Up@1ms 998
Right
# days
Up@1ms 365
Type@1ms "s"
Show
Sleep 0.1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -4,24 +4,23 @@ Output demo/menu.gif
Set Theme "Apple Classic"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
# --- START ---
Set LoopOffset 4
Hide
Type "cargo run -- -r -m c"
Type "cargo run -- -r -m p --menu"
Enter
Type@200ms "m" # hide menu
Type@200ms "m"
Show
# --- STYLES ---
Sleep 0.3s
Type@0.3s "m" # show menu
Type@0.3s "2"
Type@0.3s "3"
Type@0.3s "m"
Type@0.3s "t"
Type@0.3s "c"
Type@0.3s "p"
Type@0.3s "e"
Escape@0.3s
Type@0.3s "4"
Type@0.3s "0"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 174 KiB

View File

@ -1,35 +1,32 @@
# Note: PR "support ctrl + arrow keys" https://github.com/charmbracelet/vhs/pull/673 needs to be merged to run this `tape`.
Output demo/pomodoro.gif
# https://github.com/charmbracelet/vhs/blob/main/THEMES.md
Set Theme "Catppuccin Frappe"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
# --- START ---
Hide
Type "cargo run -- -r -d -m p --blink on"
Type "cargo run -- -d -m p --blink on"
Enter
Sleep .2
Type "m" # hide menu
Sleep 0.2
Show
# --- POMODORO WORK ---
Sleep .5
Type "s" # start
Sleep 1
Type "s"
Sleep 2.3
Type "e"
Sleep 0.2
Down@30ms 80
Sleep 100ms
Type "s" # save
Type "e"
Sleep 4
# --- POMODORO PAUSE ---
Ctrl+Right
Right
Sleep 0.5
Type "s"
Sleep 2.3
@ -37,5 +34,5 @@ Type "e"
Sleep 0.2
Down@30ms 60
Sleep 100ms
Type "s" # save
Type "e"
Sleep 4

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 139 KiB

View File

@ -4,8 +4,8 @@ Output demo/style.gif
Set Theme "OneDark"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
@ -15,7 +15,6 @@ Hide
Type "cargo run -- -r -d -m c"
Enter
Sleep 0.2
Type "m" # hide menu
Show
# --- STYLES ---
Sleep 0.5

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

@ -1,37 +0,0 @@
# https://github.com/charmbracelet/vhs/blob/main/THEMES.md
Set Theme "SeaShells"
Set FontSize 14
Set Width 1000
Set Height 500
Set Padding 0
Set Margin 1
# --- START ---
Type 'cargo run -- -r -m t'
Enter
Type "m"
Type "e"
Up@1ms 60 # ss
Left
Up@1ms 60 # mm
Left
Up@1ms 23 # hh
Left
Up@1ms 363 # ddd
Left
Up@1ms 9999 # yyyy
Right 4
Down # ss
Left
Down ## mm
Left 2
Down ## ddd
Up 2
Type "."
Type "s" # save
Type "s" # start to reach DONE
Sleep 2s
# --- SCREENSHOT ---
Screenshot demo/timer-max.png
Sleep 1s

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -4,8 +4,8 @@ Output demo/timer.gif
Set Theme "Belafonte Day"
Set FontSize 14
Set Width 1000
Set Height 500
Set Width 800
Set Height 400
Set Padding 0
Set Margin 1
@ -15,7 +15,6 @@ Hide
Type "cargo run -- -r -d -m t"
Enter
Sleep 0.2
Type "m" # hide menu
Show
# --- TIMER ---
Type "s"
@ -28,5 +27,5 @@ Type "e"
Sleep 0.2
Up@30ms 57
Sleep 0.7
Type "s"
Type "e"
Sleep 4

24
flake.lock generated
View File

@ -2,11 +2,11 @@
"nodes": {
"crane": {
"locked": {
"lastModified": 1760924934,
"narHash": "sha256-tuuqY5aU7cUkR71sO2TraVKK2boYrdW3gCSXUkF4i44=",
"lastModified": 1758758545,
"narHash": "sha256-NU5WaEdfwF6i8faJ2Yh+jcK9vVFrofLcwlD/mP65JrI=",
"owner": "ipetkov",
"repo": "crane",
"rev": "c6b4d5308293d0d04fcfeee92705017537cad02f",
"rev": "95d528a5f54eaba0d12102249ce42f4d01f4e364",
"type": "github"
},
"original": {
@ -23,11 +23,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1762065744,
"narHash": "sha256-c04mxJoCb8f6BBrdaREWmdQq+pfp395olXhC+B0G7DI=",
"lastModified": 1758782550,
"narHash": "sha256-olCvyP5r6+HQTl2EUudtjlA5UammsBpkzAl0l9+utZc=",
"owner": "nix-community",
"repo": "fenix",
"rev": "e0f24085a4a0da1c32adc308ec4c518ae886ff35",
"rev": "32f4e350c03cc5762be811e9c700e8696cd13c02",
"type": "github"
},
"original": {
@ -56,11 +56,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1761907660,
"narHash": "sha256-kJ8lIZsiPOmbkJypG+B5sReDXSD1KGu2VEPNqhRa/ew=",
"lastModified": 1758690382,
"narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2fb006b87f04c4d3bdf08cfdbc7fab9c13d94a15",
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
"type": "github"
},
"original": {
@ -81,11 +81,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1762016333,
"narHash": "sha256-PT8hXDYyeRjh9BGyLF/nZWm9TqRwP2EzeKuqUFH0M3w=",
"lastModified": 1758620797,
"narHash": "sha256-Ly4rHgrixFMBnkbMursVt74mxnntnE6yVdF5QellJ+A=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "fca718c0f2074bdccf9a996bb37b0fcaff80dc97",
"rev": "905641f3520230ad6ef421bcf5da9c6b49f2479b",
"type": "github"
},
"original": {

View File

@ -24,7 +24,7 @@
{
file = ./rust-toolchain.toml;
# sha256 = nixpkgs.lib.fakeSha256;
sha256 = "sha256-2eWc3xVTKqg5wKSHGwt1XoM/kUBC6y3MWfKg74Zn+fY=";
sha256 = "sha256-SJwZ8g0zF2WrKDVmHrVG3pD2RGoQeo24MEXnNx5FyuI=";
};
craneLib = (crane.mkLib pkgs).overrideToolchain toolchain;

View File

@ -65,17 +65,6 @@ run-sound-args path args:
# demos
alias da := demo-all
# build all demos
[group('demo')]
demo-all:
#!/usr/bin/env bash
for tape in demo/*.tape; do
echo "Building demo: $tape"
vhs "$tape"
done
alias dp := demo-pomodoro
# build demo: pomodoro
@ -159,17 +148,3 @@ alias de := demo-event
[group('demo')]
demo-event:
vhs demo/event.tape
alias dcmx := demo-countdown-max
# build demo: timer-max
[group('demo')]
demo-countdown-max:
vhs demo/countdown-max.tape
alias dtm := demo-timer-max
# build demo: timer-max
[group('demo')]
demo-timer-max:
vhs demo/timer-max.tape

View File

@ -1,6 +1,6 @@
[toolchain]
# Reminder: Always keep `rust-version` in `Cargo.toml` in sync with `channel`.
channel = "1.91.0"
channel = "1.90.0"
components = ["clippy", "rustfmt", "rust-src", "rust-analyzer"]
targets = ["x86_64-pc-windows-gnu", "x86_64-unknown-linux-musl"]
profile = "minimal"

View File

@ -1,4 +1,4 @@
use crossterm::event::{Event as CrosstermEvent, EventStream, KeyEventKind};
use crossterm::event::{Event as CrosstermEvent, EventStream};
use futures::{Stream, StreamExt};
use ratatui::layout::Position;
use std::{pin::Pin, time::Duration};
@ -92,10 +92,7 @@ fn crossterm_stream() -> Pin<Box<dyn Stream<Item = TuiEvent>>> {
// we are not interested in all events
.filter_map(|result| async move {
match result {
// filter `KeyEventKind::Press` out to ignore all the other `CrosstermEvent::Key` events
Ok(CrosstermEvent::Key(key)) => (key.kind == KeyEventKind::Press)
.then_some(TuiEvent::Crossterm(CrosstermEvent::Key(key))),
Ok(other) => Some(TuiEvent::Crossterm(other)),
Ok(event) => Some(TuiEvent::Crossterm(event)),
Err(_) => Some(TuiEvent::Error),
}
}),