Skip to content

About

Pomodoro timer plugin for the Omarchy shell: bar countdown, focus mode (notification silencing, audio muting, stay awake), ambient loops and break music incl. Spotify

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

mits.pomodoro — Pomodoro timer for the Omarchy shell

A bar-widget plugin for omarchy-shell. Shows a glyph plus countdown in the bar and opens a keyboard-driven popup for start/pause/skip/reset. Behind a Settings disclosure: focus and break lengths, an ambient loop, and a focus mode that silences notifications, mutes every other audio stream, and keeps the screen awake while a focus block runs.

Everything is painted from the live theme tokens (bar.foreground, Color.accent, bar.urgent), so switching themes recolors the widget instantly — no configuration, it simply follows omarchy theme set.

Panel Settings Another theme
Panel Settings Tokyo Night

The bar widget through a cycle — idle is just the glyph, the countdown ticks while running, pausing dims it, and a finished phase waits in the theme's active color until you start the next one (unless auto-start is on):

Idle Idle
Focus running Focus running
Paused Paused
Break ready Break ready

Install

omarchy plugin add https://github.com/maile-it-solutions/omarchy-pomodoro.git --enable

The widget lands in the bar's right section (move it with omarchy bar move mits.pomodoro). Requirements beyond a stock Omarchy install: ffmpeg for the generated ambient loops (rendered automatically on first start; without ffmpeg the ambient chips just stay silent). Break music streams use mpv (stock); YouTube-style custom URLs additionally need yt-dlp.

Update with omarchy plugin update mits.pomodoro; remove with omarchy plugin remove mits.pomodoro (afterwards you may also delete the state files under ~/.local/state/omarchy/pomodoro* and the generated sounds under ~/.local/share/mits.pomodoro/).

Optional, added to your own config (the plugin cannot install these for you):

-- ~/.config/hypr/bindings.lua — toggle the panel from anywhere
o.bind("SUPER + ALT + P", "Pomodoro", "omarchy-shell mits.pomodoro toggle")
// ~/.config/omarchy/extensions/omarchy-menu.jsonc — Trigger → Pomodoro
"trigger.pomodoro": {"icon":"󰔟","label":"Pomodoro","aliases":["pomodoro"]},
"trigger.pomodoro.open": {"icon":"󰔟","label":"Open panel","action":"omarchy-shell mits.pomodoro open"},
"trigger.pomodoro.startpause": {"icon":"󰐊","label":"Start / Pause","action":"omarchy-shell mits.pomodoro startPause"},
"trigger.pomodoro.skip": {"icon":"󰒭","label":"Skip phase","action":"omarchy-shell mits.pomodoro skip"},
"trigger.pomodoro.reset": {"icon":"󰜉","label":"Reset","action":"omarchy-shell mits.pomodoro reset"},

Files

File Purpose
manifest.json Plugin manifest (kinds: ["bar-widget"], defaults, settings schema)
Panel.qml Bar button + popup panel, IPC handler, state/log files, ambient + break-music Processes, Spotify over Quickshell.Services.Mpris, focus-effects orchestration
Model.js Pure logic (no Qt): timer transitions, formatting, which effects the state wants, daily stats
bin/pomodoro-focus Applies/restores side effects: DND, stream muting, stay-awake; logs completed blocks
bin/generate-sounds ffmpeg script that renders the ambient loops

Where things live

  • Settings: the widget's entry in ~/.config/omarchy/shell.json under bar.layout.* — written through the shell's updateEntryInline, the same path the clock uses for its format.
  • Timer state (phase, running/paused/ready, end time, session count): ~/.local/state/omarchy/pomodoro.json. Survives omarchy restart shell and is shared by every bar instance (one per monitor).
  • Focus-effects snapshot (what was changed, so it can be restored exactly): ~/.local/state/omarchy/pomodoro-session.json, present only while an effect is applied.
  • Completed focus blocks: ~/.local/state/omarchy/pomodoro-log.jsonl ({"t": epoch, "minutes": N} per line) — drives the "TODAY n BLOCKS" line.
  • Ambient loops: ~/.local/share/mits.pomodoro/sounds/{tick,rain,brown}.ogg. Regenerate with bin/generate-sounds.

Settings

Setting Default Meaning
Focus / Short break / Long break 25 / 5 / 15 min Phase lengths; presets 25/5, 50/10, 90/20
Sessions before long break 4 Focus blocks per cycle (the dots)
Ambient sound Off Tick / Rain / Brown loop through mpv while focus runs
Volume 40 % Ambient loop volume (slider, wheel, h/l)
Ambient sound on breaks too off Keep the loop running during breaks (break music wins when both are on)
Break music off Play music while a break runs. Stations: SomaFM Heavyweight Reggae (default), Reggae Chill Café, FIP Reggae, La Grosse Radio Reggae, Spotify, Custom
Break station: Spotify — Drives the Spotify desktop app over MPRIS: play when the break starts, pause when it ends; launches Spotify if it is not running. Optional spotify:playlist:… URI in the source field opens that playlist first, otherwise it resumes whatever is queued. Volume is set through MPRIS.
Break station: Custom — Source field takes a stream URL, a page URL yt-dlp can resolve (YouTube…), or a local folder/file (~/Music/reggae, shuffled and looped)
Break music volume 50 % Separate from the ambient volume
Focus mode → notifications Off Every break: silence during focus, replay what was missed when any break starts. Long break: silence through focus and short breaks, replay only when the long break starts
Mute other audio off Mute every other PipeWire output stream during focus (headphones: only the ambient loop and the chime stay audible). New streams are caught within 2 s. Apps that are capturing the microphone — i.e. in a call (Teams, Zoom, a browser tab) — are never muted, and a stream muted earlier is released within 2 s once its app starts a call. Streams the user had muted already are left alone. Switching the toggle off force-unmutes every stream immediately.
Stay awake off No screensaver/lock during focus (omarchy-shell idle disable), restored afterwards
Chime when a phase ends on freedesktop complete.oga via mpv, exempt from the mute
Auto-start next phase off Otherwise the next phase waits as ready (bar turns the theme's active color)

Prior state is snapshotted the first time an effect is applied and restored exactly when it is released: if DND or stay-awake was already on before the focus block, it stays on afterwards.

Controls

Where Input Action
Bar widget left click open / close panel
Bar widget right click start / pause
Bar widget middle click skip to next phase
Bar widget scroll (idle) focus length ±1 min
Anywhere SUPER + ALT + P toggle panel (if you added the binding above)
Omarchy menu Trigger → Pomodoro Open / Start-Pause / Skip / Reset
Panel space (no row selected) / p start / pause
Panel r / s / , reset / skip / toggle settings
Panel j k / h l move between rows / adjust the row's value or pick a chip
Panel Enter activate the row under the cursor
Panel Esc close

IPC

omarchy-shell mits.pomodoro toggle        # panel
omarchy-shell mits.pomodoro open|close|settingsToggle
omarchy-shell mits.pomodoro start|pause|startPause|skip|reset
omarchy-shell mits.pomodoro status        # timer state as JSON
omarchy-shell mits.pomodoro debug         # leader / flags / ambient
~/.config/omarchy/plugins/mits.pomodoro/bin/pomodoro-focus status      # applied effects
~/.config/omarchy/plugins/mits.pomodoro/bin/pomodoro-focus streams     # what would be muted / exempt as a call
~/.config/omarchy/plugins/mits.pomodoro/bin/pomodoro-focus unmute-all  # emergency: unmute everything

Behaviour notes

  • Phase end: the next phase is queued as ready (bar and clock in the theme's urgent/active color, progress bar full) until you start it, unless auto-start is on. A notification (omarchy-notification-send, which bypasses DND by design) and the chime fire once, from the primary-screen instance only.
  • Focus mode silences app notifications (Teams, Slack, browsers…) by turning on Omarchy's own DND; the shell files them into its notification history. When the rule releases DND, notifications showHistory replays them as toasts — only if something new arrived.
  • Muting is per stream, never the sink, so the ambient loop and the chime (both tagged --audio-client-name=mits.pomodoro) keep playing. Unmuting matches stream id and serial, so a recycled id is never touched.
  • Pause, skip, reset, the phase ending, and a shell restart all re-derive the wanted effects from the state file; bin/pomodoro-focus apply is idempotent and serialized (flock + one Process), so nothing is left half-applied.
  • Ambient mpv loops from a crashed shell are reaped on the next start.

Developing

Edits to Panel.qml are picked up by the shell's file watcher, but the compiled QML is cached — after changing QML/JS run omarchy restart shell. Shell log: qs log /run/user/1000/quickshell/by-pid/<pid>/log.qslog -t 200. Logic in Model.js can be exercised with plain Node:

node -e 'const src=require("fs").readFileSync("Model.js","utf8").replace(".pragma library","");
const m={};new Function("exports",src+"\nObject.assign(exports,{normalizeSettings,initialState,start,finish,focusFlags});")(m);
const s=m.normalizeSettings({focusDnd:"break",muteOthers:true});let st=m.start(m.initialState(s),s,0);
console.log(m.focusFlags(st,s), m.finish(st,s,st.endAt+1))'

License

MIT — see LICENSE.

About

Pomodoro timer plugin for the Omarchy shell: bar countdown, focus mode (notification silencing, audio muting, stay awake), ambient loops and break music incl. Spotify

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages