Repository navigation
feat(cli): Linux desktop notification with estimated reading time - #25
Merged
Merged
Conversation
Hotkey / `tts-ka cb` runs have no visible terminal, so there was no way to
know how long a read would take. When audio will play, main now sends a
notify-send bubble ("🔊 Reading ~10 min · 1,150 words · ka · done ≈ 15:51").
The estimate uses measured per-language edge-tts speeds (en 180, ru 130,
ka 115 wpm) on the sanitized text, scaled by --rate; the chunking WPM of
160 would be ~40% short for Georgian. Each read replaces the previous
bubble. Off with --no-notify, TTS_KA_NOTIFY=0 or "notify": false.
The CLI banner and the --json start event also carry the estimate. Tests
disable notifications globally so they never pop on the dev desktop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Runs started from a hotkey or with
tts-ka cbhave no visible terminal, so there was no way to tell how long a read would take. Now, whenever audio will play on Linux, the CLI shows anotify-sendnotification as it starts:notify.SPEECH_WPM). It is scaled by--rateand counts only text that will be spoken (replace_not_readabledrops code blocks and URLs first). The chunking constantWPM = 160would make Georgian estimates about 40% too short, so it's left for chunk sizing only.x-canonical-private-synchronoushint) instead of stacking them.--no-play,--live, study mode and the GUI. It's also skipped on systems other than Linux, and whennotify-sendisn't installed.--no-notify,TTS_KA_NOTIFY=0, or"notify": falsein the config file (mapped to the env var inapply_env_from_config).notify-sendruns with a 3 s timeout, and OS or subprocess errors are swallowed.~N min, and the--jsonstartevent includesestimated_seconds.--help-full, shell completions andCLAUDE.md.Test plan
pytestpasses: 833 tests, 87.8% coveragetests/test_notify.pycovers rate parsing, per-language estimates, duration formatting, the end time, enable/disable via platform, binary and env, the config mapping, thenotify-sendargv, and errors never raisingtests/test_main.py: notification sent by default and with--stream; not sent with--no-playor--no-notifyconftest._no_desktop_notificationsfixture stops the test suite from showing real notifications on the desktopmypy src/TTS_ka/notify.pyis clean🤖 Generated with Claude Code