Idly-media-pause

AnkiWeb addon 1466024936

Pauses currently playing media after an idle period while reviewing, then resumes only those paused players when the card is graded or the reviewer is left, on Linux via MPRIS.
AI-generated summary; may contain mistakes.

review-flow

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
0 (πŸ‘ 0 Β· πŸ‘Ž 0)
Updated
2026-09-21
Anki versions
2.1.66~
License
MIT (from the GitHub repository)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JSON
Description language
en

Maintenance

active

  • Last update or commit: 2026-09-21 (41 days before the snapshot).
  • Test files: 3.
  • Commits in the last year: 3.
  • Issues: 0 open, 0 closed.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.12.1.66+2026-09-21
History across monthly snapshots

Loading…

Similar addons

Background Auto Sync fork

Silently syncs the collection in the background after configurable idle periods, without stealing focus, syncing only on detected changes and deferring during dialogs, focus, or reviews.

sync-integrationreview-flowfork-or-reupload

7 votes 36% approval πŸ‘ 5 Β· πŸ‘Ž 2 ⭐ 3 Anki 2.1.1~ Updated 2026-09-25
Pomodoro Bar

Times Pomodoro study sessions with fillable progress and review-counter bars, color-coded answer segments, optional rest periods, pause/resume, notices, and configurable goals, colors, and screen controls.

review-flowprogress-trackingtimer

1 votes 21% approval πŸ‘ 1 Β· πŸ‘Ž 0 ⭐ 0 Anki 2.1.1~ Updated 2026-10-06
Anki Dungeon

Turns flashcard reviews into an idle rogue-like RPG where a four-character party auto-battles across dungeons while you choose power-ups, relics, companions and difficulty.

gamification

4 votes 51% approval πŸ‘ 4 Β· πŸ‘Ž 0 Anki 2.1.1~ Updated 2026-10-21
Learn2Rot

Grants screen time for answering flashcards, drains it during media playback, auto-pauses when time runs out, and works with any keyboard-controllable media via customizable cube visuals.

progress-trackinggamificationtimer

3 votes 21% approval πŸ‘ 2 Β· πŸ‘Ž 1 ⭐ 0 Anki 26.05~ Updated 2026-10-01

Description

When reviewing, after a certain time has passed (default 8 seconds), pause playback.

Resume when you have answered the card.

For days when you are cranking through cards while watching something, keeps you not stopping anki

MIT Licensed slop code that does the trick

https://github.com/fromheten/anki-idly-media-pause

Only works on 🐧 linux with dbus, I've tried it on GNOME

README

Idle Media Pause

An Anki add-on that pauses your music while you are away from a card, and starts it again when you come back.

If you stop interacting with the card being shown, whatever is currently playing gets paused. When you grade the card, exactly those players start again β€” nothing else, and nothing that was not already playing.

Behaviour

What happens What the add-on does
Question shown Starts the idle timer
Answer revealed Restarts the timer, and stays paused if it paused
Timer runs out Pauses everything currently playing, and remembers it
Card graded Resumes only what it paused
You leave the reviewer Resumes what it paused

Revealing the answer keeps the music paused on purpose β€” you are still on the card. Only moving on brings it back.

Three rules it never breaks:

  • If nothing is playing, nothing happens. It will not start your music.
  • A player you paused yourself is never resumed, because it was not playing when the timer fired and so was never recorded.
  • It sends explicit Pause and Play, never the PlayPause toggle your keyboard's media key sends. A toggle fired from a timer eventually does the opposite of what you wanted.

How long is "idle"?

Eight seconds, out of the box. Change idle_seconds in the add-on config to taste.

Setting it to 0 follows the deck's Maximum answer seconds (Deck options β†’ Timers) instead, which is Anki's own idea of how long an answer should take β€” 60 seconds unless you changed it, and different per deck if you set it that way. A fixed number is usually better: if you raised the deck setting to stop Anki capping your recorded answer times, the idle timeout would otherwise inherit that long value.

Requirements

Linux, and either playerctl or gdbus on your PATH. gdbus is part of GLib, so it is almost certainly already installed; playerctl is preferred when present. Any player speaking MPRIS works β€” Spotify, VLC, Firefox, Chromium, and most others do.

On macOS and Windows the add-on loads and does nothing.

Your card audio is unaffected: Anki runs mpv with its own config directory, which stops mpv-mpris loading, so Anki's player never appears on the bus.

Install

From AnkiWeb: not published yet.

From a release file: Tools β†’ Add-ons β†’ Install from file, and pick the .ankiaddon.

Configuration

Tools β†’ Add-ons β†’ Idle Media Pause β†’ Config. Every setting is documented in the panel beside it; see src/idle_media_pause/config.md.

Development

./dev-install.sh     # symlink into ~/.local/share/Anki2/addons21
./build.sh           # produce dist/idle_media_pause.ankiaddon
pytest tests/        # the MPRIS layer, no Anki needed

There is a flake, so nix develop puts Anki, playerctl, GLib, zip and pytest on your PATH and none of the above needs anything else installed. Without it, build.sh still needs zip.

nix develop          # the shell the three commands above expect
nix build            # the .ankiaddon, in result/share/anki/addons
nix flake check      # the test suite

Run Anki from a terminal to see the add-on's output, and drop idle_seconds below the shipped 8 while testing β€” waiting out the timer on every case gets old fast.

The code splits three ways:

  • mpris.py β€” talking to media players. No Anki imports, which is what makes it testable without a GUI. All parsing lives here.
  • controller.py β€” the timer and the record of what was paused.
  • __init__.py β€” hook wiring, and nothing else.

Testing against a bundled Anki

One bug only appears outside Nix and other distro packages: Anki's official Linux bundle sets LD_LIBRARY_PATH to its own Qt and GLib, and a helper that inherits it loads the wrong libraries and fails with symbol errors. mpris.build_env() strips it, the same way Anki does before launching mpv. If you change how subprocesses are spawned, test that change against an official Anki build, because a Nix or distro Anki will not reveal the breakage.

License

MIT

Who wrote this?

It's vibe coded.