Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Problem
The store's now-playing package shows the track from Music or Spotify with controls. It's a stream script in JavaScript for Automation, plus a shell script that runs osascript for each control. So it:
- is a package that runs commands, which a maintainer must review for each version;
- reads the position through Apple Events every second while a track plays;
- covers only Music and Spotify, not Podcasts, browsers or other players that the macOS Now Playing menu shows.
Barik and simple-bar have a now-playing widget built in, Waybar has mpris, and zebar had a request for one (zebar #73, 22 reactions).
Proposal
- A
nowPlayingprovider:textis the title, withfields.title,fields.artist,fields.album,fields.player,fields.playing(trueorfalse),fields.artwork(a file path or URL forimageblocks), andvalues.position,values.durationandvalues.progress(0–1). It sends anowPlayingChangeevent. - Actions for play/pause, next and previous that need no shell, so a package of
"kind": "widgets"can offer controls. - It updates when the player posts a change and reads the position only while something shows it, for example while the popup is open.
- Its registry entry declares Automation access for each player, so setup lists it.
How it reads players is the open question:
- Per-app Apple Events, public. Music posts
com.apple.Music.playerInfoand Spotifycom.spotify.client.PlaybackStateChangedas distributed notifications; Scripting Bridge orNSAppleScriptreads the track and sends controls. It needsNSAppleEventsUsageDescriptionand Automation access for each app, and covers only players with a scripting dictionary. This is what the package does today, moved in-process. - MediaRemote, private. It covers every player the system knows. macOS 15.4 restricted the private MediaRemote framework to Apple processes. mediaremote-adapter works around this by loading a helper framework into
/usr/bin/perl, which keeps the entitlement. That conflicts with StableBar's public-API stance and could break in any macOS update. Reports on macOS 26 are mixed: reading works, and sending commands worked for some users and not others. I could not verify it on macOS 26 myself.
Option 1 fits the project; option 2 would need an explicit exception, as the opt-in macOS Spaces source has.
Possible today
Yes, for Music and Spotify, through the store's now-playing package, which runs scripts and needs Automation access. Other players need a script built on a third-party tool such as media-control.
Related
- Register data sources behind one interface, including event-driven ones #17 listed a
nowPlayingprovider among the sources its registry would enable; feat: register data sources behind one interface, including event-driven ones #53 left it for its own pull request. - Add a widget package kind that runs no commands #32 added packages that run no commands; a native provider lets the now-playing package become one.
- The
equalizerblock (feat: add an equalizer block that bounces while its source is on #141) already bounces while asourcefield is on, so it can usefields.playing.
Triaged by Claude Code via T3 Code (Claude Opus 5.5).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity