Repository navigation
omalauncher media: Linux players in Android's media controls (lock screen, car, headset buttons) - #267
Open
petrzpav wants to merge 4 commits into
Open
omalauncher media: Linux players in Android's media controls (lock screen, car, headset buttons)#267petrzpav wants to merge 4 commits into
petrzpav wants to merge 4 commits into
Conversation
…hone media set` with a track's title, artist, album, cover (an https URL or a file in Linux), length, position, speed and whether it plays publishes a media session and its notification, so the lock screen, the notification shade's player, a car's display and steering-wheel buttons over Bluetooth, a watch and headset and AirPods buttons show and steer it; a press runs the player's command in Linux with the action after it (play, pause, next, previous, stop, or seek and the second), and is shown at once until the player's next set; a set without a title changes only the fields it has, as a player says it paused, and `phone media clear` takes it away, as removing Linux does Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
petrzpav
marked this pull request as ready for review
November 6, 2026 17:17
t1nk333r
pushed a commit
to t1nk333r/omalauncher
that referenced
this pull request
Nov 10, 2026
…droid's media controls (lock screen, car, headset buttons) Ported onto the omalauncher command (phone.sh is gone since 0.20): `omalauncher media` is one of its commands, its wrong arguments answer as usage (exit 2), and stopping Linux clears the player as removing it does.
…nd's rename (c6163e3): its usage and argument check are in omalauncher.sh, it's in COMMANDS, the README and the guest's AGENTS.md, a JSON written over several lines goes as it is (requests end each argument with a NUL now), a set the launcher can't take answers usage (exit 2), and the CHANGELOG entry goes, as entries come with a release Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Hi Simon, I updated this to current main: it's |
…and Japanese too, as lint asks now that main speaks them (SimonSchubert#267) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Guest audio already plays as Android media (
AudioBridge), but to the phone nothing is playing: no lock-screen player, nothing in the notification shade, a car shows no track over Bluetooth and its steering-wheel buttons, a headset's or AirPods' presses go to whatever Android app played last. This lets a Linux player say what it plays withomalauncher media, and the launcher publishes it as an Android media session. Closes #122.A press anywhere (lock screen, shade, car, headset, watch) runs the player's
commandin Linux with the action after it:myplayer-ctl play|pause|next|previous|stopormyplayer-ctl seek 120.actionslimits which ones the player offers (default all butstop); without acommandthe session shows the track and offers none. Each press is shown at once (playing/paused, where a seek went) until the player's nextset.How
LinuxMedia.kt: a platformMediaSession(no new dependency) with metadata,PlaybackState(position, speed and update time, so Android runs the clock) and aMediaStylenotification on its own low-importance channel, "Playing from Linux". The cover comes from an https URL or a file in Linux, scaled to ≤512 px, once per track. Before Android 13 the notification's own buttons go through a not-exported receiver; from 13 on Android draws them from the session.PhoneBridge:media,media set <json>,media clear, in the same inbox as location, calendar and airpods. A set that isn't one JSON object, has an unknown field, or has no title while nothing is set answersusage:(exit 2), naming why.mediais inCOMMANDS, soomalauncher versionlists it.omalauncher.sh: the usage text and the argument check. Requests end each argument with a NUL now, so a JSON object written over several lines goes as it is.OmalauncherScriptTest.mediaSendsItsJsonWholechecks that, andcommandsAgreecovers the new command.Runtime: creates it lazily and clears it when Linux is removed. The guest's AGENTS.md paragraph onomalauncherand the README's section mention it, so agents know a player can do this.Not in this PR: Android Auto's browsing (needs a
MediaBrowserService), audio focus (a call or another app playing doesn't pause the guest; the guest's player still decides), and MPRIS: there's no session D-Bus in the guest; a smallplayerctl-based adapter could driveomalauncher medialater.Tested
After merging main (1.3.0, at 30f208c):
./gradlew :owl:test :app:testDebugUnitTest :owl:owlJarand./gradlew :app:assembleDebug :app:lintDebugpass,OmalauncherScriptTestincluded (15 tests, with the newmediaSendsItsJsonWhole). Not run on the phone again since the port:LinuxMediais unchanged, and the port changes only the command's name, the NUL-ended request and theusage:answers.Before the rename (on 0.20.0, when the command was still
phone), on a Pixel 9 Pro XL (Android 17), as the side-by-side debug copy with Linux set up, driving the inbox overadb run-asas the script does (the play command only logged its arguments) and tapping the system player's buttons:media setwith a SoundCloud set (5 h 17 min, its cover by https URL): the session is active and PLAYING at 2:03:00 with title, artist, album and duration; the shade's and the lock screen's player show it with the cover, the clock running on.<command> <action>in Linux, in that order; tapping 70% along the seek bar ran<command> seek 13266and the player went there at once. Paused shows play and a still bar.{"playing": false, "position": 7421}(no title) changed only those; a set with an unknown field, or not an object, or without a title while nothing is set, answers an error naming why.media clear: the notification and the session are gone;mediaanswers null.cmd media_session dispatchsends keys to the app Android last heard playing audio, and the test copy played none; with a guest player's audio going throughAudioBridgethat's this app.🤖 Generated with Claude Code