Skip to content

feat(gnome-extension): show the panel only while YourTune runs, with show window and quit - #32

Merged
bercedev merged 3 commits into
robotlog:masterfrom
sungyongcho:feat/gnome-extension-follow-yourtune
Nov 5, 2026
Merged

bercedev merged 3 commits into
robotlog:masterfrom
sungyongcho:feat/gnome-extension-follow-yourtune

Conversation

@sungyongcho

@sungyongcho sungyongcho commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Part 1 of #30, on top of #31.

Changes

  • The panel follows YourTune. The extension watches org.mpris.MediaPlayer2.YourTune with Gio.bus_watch_name. When the name appears, the icon shows and the client connects; when it goes away, the menu closes, the icon hides and the client stops. While YourTune is closed there is no "not reachable" screen and no retry loop. The client's new stopped status also cancels a pending /auth if YourTune quits while its dialog is open.
  • Show window and quit, next to the volume slider, since the tray icon is gone once the mini player connects. They use POST /window/show and POST /quit. The artwork goes through /window/show too. On YourTune 1.4.1 and older, show window falls back to raising the window or launching the app as before, and the quit button hides after a 404, like the mix button.
  • If YourTune runs but its API Server is off, the card says so and keeps Retry, and the client still retries with backoff. That also covers the API Server coming up a moment after the bus name.
  • A host other than 127.0.0.1, localhost or ::1 in the preferences isn't covered by a bus name on this machine, so the panel stays on for it as before.
  • New power-symbolic.svg from power-settings-new--rounded, through tools/generate-icons.mjs. The README says when the icon shows and that the Shortcuts plugin provides the bus name.

Screenshot

The card with YourTune running, with show window and quit at the end of the volume row:

Mini player card playing One More Time by Daft Punk, with an open-in-new and a power button to the right of the volume slider

Testing

In a nested GNOME Shell 50.1, with YourTune master (#31) running from source inside the nested session so its bus name is on the same session bus:

  • YourTune closed: the icon is hidden, status stopped, no reconnect timer.
  • YourTune started: the icon shows and connects once the bus name appears.
  • Show window: POST /window/show 204, the menu closes and YourTune's window gets focus.
  • Quit: POST /quit 204, YourTune exits, the bus name goes away and the icon hides with nothing pending. A second launch brings it back.
  • node --test 'extras/gnome-extension/tests/*.test.js': 13 pass. I don't have shexli here; the new code logs through _logFailure, so the ungated console.error count doesn't change.

Question

The bus name comes from the Shortcuts plugin (registerMPRIS in its onMainLoad). With that plugin off, the panel never shows. Is that fine, or should the API Server own a small bus name of its own for this?

…show window and quit

The panel follows YourTune's org.mpris.MediaPlayer2.YourTune bus name instead of polling the API Server: the icon appears and connects when YourTune starts, and goes away when it quits, so there is no "not reachable" screen or retry loop while YourTune is closed. Since YourTune now drops its tray icon once the mini player connects, the card gets the tray menu's show window and quit, through POST /window/show and POST /quit, and falls back to raising the window or hides the quit button on YourTune 1.4.1 and older.

@bercedev bercedev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, 13/13 here and shexli is clean on the packed files (it only flags .gitignore, tests and tools, which pack.sh leaves out)

on your question: fine to depend on the shortcuts plugin. it's on by default and it's what gives yourtune its media keys and MPRIS on linux, so someone with it off already has no media controls anywhere. no extra bus name for now

one thing before merge: could you add a changelog line under #### Unreleased → Features, something like
- GNOME Shell mini player shows only while YourTune runs, with show window and quit, thanks to @sungyongcho ([#32](https://github.com/robotlog/YourTune/pull/32)).
we keep each PR's line in its own squash commit

@sungyongcho

Copy link
Copy Markdown
Contributor Author

thanks! added the changelog line in dad089b, under #### Unreleased → Features right after the #31 one, and left the Shortcuts plugin dependency as is.

@sungyongcho

Copy link
Copy Markdown
Contributor Author

one more small change in 49272a0: the changelog line credits it as "by @sungyongcho" instead of "thanks to", since it's my own work rather than a report or a port. happy to switch it back if you'd rather keep "thanks to" for contributors.

@bercedev
bercedev merged commit f92ef51 into robotlog:master Nov 5, 2026
6 checks passed
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.

2 participants