Compare commits

...

6 Commits
v1.6.0 ... main

Author SHA1 Message Date
Jens Krause
ca9d17f1ee
Rust 1.91.0 (#140) 2025-11-03 17:23:06 +01:00
jk
1bebfb897a
fix(demo): hide menu from local-time-footer demo 2025-10-29 12:04:36 +01:00
Jens Krause
90c0e50f1c
Prepare v1.6.1 (#138) 2025-10-29 11:31:42 +01:00
Jens Krause
27cb8c7e33
fix: filter KeyEventKind::Press out (#137)
to ignore all the other `CrosstermEvent::Key` events
2025-10-29 11:03:49 +01:00
jk
513f1fec11
fix(tape) typo 2025-10-19 19:03:21 +02:00
Jens Krause
1742d68c61
update all demos (#135)
- new size: `1000x500`
- remove deprecated demos
- `just da`: build all demos
- update README
2025-10-19 19:02:04 +02:00
43 changed files with 171 additions and 184 deletions

View File

@ -1,5 +1,21 @@
# 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.0"
version = "1.6.1"
dependencies = [
"clap",
"color-eyre",

View File

@ -1,10 +1,10 @@
[package]
name = "timr-tui"
version = "1.6.0"
version = "1.6.1"
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.90.0"
rust-version = "1.91.0"
homepage = "https://github.com/sectore/timr-tui"
repository = "https://github.com/sectore/timr-tui"
readme = "README.md"

View File

@ -37,19 +37,13 @@ _(theme depends on your terminal preferences)_
<img alt="pomodoro" src="demo/timer.gif" />
</a>
## Countdown
## Countdown (*incl. [Mission Elapsed Time](https://en.wikipedia.org/wiki/Mission_Elapsed_Time)*)
<a href="demo/countdown.gif">
<img alt="countdown" src="demo/countdown.gif" />
</a>
## 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)
## Event (*past/future*)
<a href="demo/event.gif">
<img alt="event" src="demo/event.gif" />
@ -61,7 +55,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" />
@ -73,6 +67,13 @@ _(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: 39 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

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

BIN
demo/countdown-max.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@ -1,22 +0,0 @@
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.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,20 +0,0 @@
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.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,20 +0,0 @@
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: 83 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,41 +0,0 @@
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: 130 KiB

After

Width:  |  Height:  |  Size: 179 KiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 185 KiB

View File

@ -1,32 +1,35 @@
# 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 800
Set Height 400
Set Width 1000
Set Height 500
Set Padding 0
Set Margin 1
# --- START ---
Hide
Type "cargo run -- -d -m p --blink on"
Type "cargo run -- -r -d -m p --blink on"
Enter
Sleep 0.2
Sleep .2
Type "m" # hide menu
Show
# --- POMODORO WORK ---
Sleep 1
Type "s"
Sleep .5
Type "s" # start
Sleep 2.3
Type "e"
Sleep 0.2
Down@30ms 80
Sleep 100ms
Type "e"
Type "s" # save
Sleep 4
# --- POMODORO PAUSE ---
Right
Ctrl+Right
Sleep 0.5
Type "s"
Sleep 2.3
@ -34,5 +37,5 @@ Type "e"
Sleep 0.2
Down@30ms 60
Sleep 100ms
Type "e"
Type "s" # save
Sleep 4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

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

BIN
demo/timer-max.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

37
demo/timer-max.tape Normal file
View File

@ -0,0 +1,37 @@
# 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: 64 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

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

24
flake.lock generated
View File

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

View File

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

View File

@ -65,6 +65,17 @@ 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
@ -148,3 +159,17 @@ 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.90.0"
channel = "1.91.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};
use crossterm::event::{Event as CrosstermEvent, EventStream, KeyEventKind};
use futures::{Stream, StreamExt};
use ratatui::layout::Position;
use std::{pin::Pin, time::Duration};
@ -92,7 +92,10 @@ fn crossterm_stream() -> Pin<Box<dyn Stream<Item = TuiEvent>>> {
// we are not interested in all events
.filter_map(|result| async move {
match result {
Ok(event) => Some(TuiEvent::Crossterm(event)),
// 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)),
Err(_) => Some(TuiEvent::Error),
}
}),