hovancik/stretchly

[Feature request]: Get current state from CLI

Open

#1628 opened on Aug 14, 2025

View on GitHub
 (3 comments) (1 reaction) (0 assignees)JavaScript (3,892 stars) (410 forks)batch import
enhancementhelp wanted

Description

Version

  • I'm using version 1.17.2

Existing requests

  • I've checked Existing requests

Advanced Preferences

  • I've checked Advanced Preferences

What operating system are you using?

Linux

Operating System Version

Linux Cuddles-Bobba 6.15.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 02 Aug 2025 01:20:06 +0000 x86_64 GNU/Linux

Problem description

I would like to add Stretchly to my status bar (polybar to be exact). While it can be added as a tray icon, I want immediate access to more information like current pause state, time to next mini/long break, etc. Polybar (and other text statusbars) work by periodically running scripts and displaying their outputs, but stretchly CLI command does not seem to have a status command.

Possible solution

Add stretchly status command which displays relevant dynamic state information in script-friendly format, e.g. JSON. Example output:

{
    "seconds_paused": 0,  // implies unpaused
    "seconds_to_mini_break": 120,
    "seconds_to_long_break": 3600
}

Alternative solutions

Some of this information can already be deduced from logs and config, e.g.:

[2025-08-14 22:18:24.147] [info]  Stretchly: finishing Mini Break (shouldPlanNext: true)

combined with

	"microbreakInterval": 300000,

And current date 2025-08-14 22:21:45.481, you can calculate the next mini break to be in:

2025-08-14 22:21:45.481 - 2025-08-14 22:18:24.147 = 3min21s334ms
300000ms - 3m21s334ms = 5min - 3m21s334ms = 1m38s666ms

But the logs show not be considered a stable API, plus may fall apart on some edge cases (e.g. mini break timer resetting due to long break on pauses).

Additional information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributor guide