Skip to content

fix: let desktop media widgets control the volume on Linux - #165

Open
zebus3d wants to merge 1 commit into
noFAYZ:mainfrom
zebus3d:fix/linux-mpris-volume
Open

zebus3d wants to merge 1 commit into
noFAYZ:mainfrom
zebus3d:fix/linux-mpris-volume

Conversation

@zebus3d

@zebus3d zebus3d commented Oct 9, 2026

Copy link
Copy Markdown

What and why

Zuno publishes playback over MPRIS but never its volume, so desktop media widgets can neither show nor change it. As #139 describes, Volume always reads 1 and setting it does nothing. On KDE Plasma, for example, scrolling over the Media Player tray icon or moving its volume slider has no effect on Zuno.

This adds volume to the Linux MPRIS session in both directions:

  • Desktop → app: SetVolume from MPRIS is forwarded to the frontend as a new setVolume action on the existing linux-media-control event, and applied with controller.setVolume.
  • App → desktop: Rust listens to player-volume-sync, the event the main window already emits on every volume or mute change (the one the mini player follows), and publishes it with souvlaki's set_volume. Mute is published as 0.

The published level always comes from the app itself: a change made from the desktop goes to the app first and comes back through player-volume-sync. This also gives MPRIS the confirmation it expects, so the desktop's slider does not snap back. The last value is kept even before the MPRIS session exists, so the session starts at the right level.

Closes #139

How it was checked

  • npm run verify passes
  • cargo test passes
  • Ran the app and used the affected feature: EndeavourOS, KDE Plasma 6.7.5. The mouse wheel over Plasma's Media Player tray icon changes Zuno's volume, and in-app changes show up in Plasma.
  • The busctl steps from Linux: MPRIS volume control does not change Zuno's actual audio volume #139: set-property … Volume d 0.3 changes Zuno's volume, and get-property reads the new value back.

Notes for the reviewer

Linux only; Windows and macOS are untouched. It reuses the existing player-volume-sync event instead of adding a volume field to the once-a-second media update, so in-app changes reach the desktop right away and there is no stale value racing a fresh one.

Zuno already publishes playback over MPRIS, but not its volume, so desktop
media widgets could neither show nor change it. On KDE Plasma, for example,
the mouse wheel over the media player tray icon did nothing for Zuno.

The Linux session now handles MPRIS volume both ways. A change made from the
desktop is sent to the app, and the app's volume is mirrored back from the
`player-volume-sync` event it already emits on every change (the one the
mini player follows). The published level therefore always comes from the
app itself, and an in-app change reaches the desktop right away rather than
on the next once-a-second position update.
@vercel

vercel Bot commented Oct 9, 2026

Copy link
Copy Markdown

@zebus3d is attempting to deploy a commit to the Faizan Asad's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

Linux: MPRIS volume control does not change Zuno's actual audio volume

1 participant