Skip to content

Let addons read what's playing and put a card on your profile (GRYT-1637) - #746

Merged
sivert-io merged 2 commits into
mainfrom
claude/GRYT-1637-listening
Sep 29, 2026
Merged

sivert-io merged 2 commits into
mainfrom
claude/GRYT-1637-listening

Conversation

@sivert-io

@sivert-io sivert-io commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Sivert wanted "Listening to" as Gryt's first real addon. Addons run sandboxed and can't start programs, so the app reads the media controls and addons ask for them through permissions.

Two new addon permissions, agreed to per addon in Settings → Addons like the others:

  • media: gryt.media.current() and gryt.media.on(handler) (checked every 15 s while an addon listens). Windows reads its media session through PowerShell, Linux MPRIS through gdbus, and macOS asks Spotify and Music with AppleScript, only while they're running, since macOS keeps its system Now Playing to Apple's own apps. macOS asks the person the first time.
  • activity: gryt.activity.set({ type: "listening", name, details, state, startedAt }) and gryt.activity.clear(). The main process checks every field. The card goes through the Rich Presence board, so a game still wins, and it works with Rich Presence off. A stopped addon's card comes down.

Risk levels: every permission now has one. Low only changes what you see (display), medium can show things about you to others (status, activity, processes, media), high can send data to the servers you are on (messaging). Settings → Addons shows the addon's riskiest level as a badge above its permissions, and each permission's level beside it.

What to look at

  • Only tested by the parsers' checks (scripts/check-now-playing.mjs: Windows JSON, MPRIS GVariant text, the osascript line). The PowerShell script and MPRIS calls haven't run on a real Windows or Linux machine yet.
  • Nothing reads the media controls unless an addon holding media is on and listening.

The addon itself comes next in its own repo, Gryt-chat/addon-now-playing.

🤖 Generated with Claude Code

sivert-io and others added 2 commits September 30, 2026 00:33
…637)

Two new addon permissions, agreed to per addon like the others. media
reads what the OS media controls say is playing: Windows' media session,
MPRIS on Linux, and on macOS Spotify and Music asked directly, since
macOS keeps its own Now Playing to Apple. activity lets an addon put a
card like "Listening to" on your profile, on every server.

Nothing reads the media controls unless an addon with media is on and
listening, and a stopped addon's card comes down with it. The card goes
through the same board as games, so a game still wins over it, and it
works with Rich Presence off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each permission gets a level: low only changes what you see, medium can
show things about you to others, high can send data to the servers
you're on. Settings shows the addon's riskiest level above its
permissions, and each permission's own level beside it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sivert-io
sivert-io merged commit dbd40a2 into main Sep 29, 2026
15 of 16 checks passed
@sivert-io
sivert-io deleted the claude/GRYT-1637-listening branch September 29, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant