feat(desktop): MPRIS, system tray, and OS integration (P3-16)#92
Merged
forkwright merged 2 commits intomainfrom Mar 14, 2026
Merged
feat(desktop): MPRIS, system tray, and OS integration (P3-16)#92forkwright merged 2 commits intomainfrom
forkwright merged 2 commits intomainfrom
Conversation
Implements full OS integration for the Harmonia desktop app: - MPRIS v2 D-Bus service (Linux only) via mpris-server 0.8; bridges PlaybackEngine state changes to PropertiesChanged signals; supports play/pause/stop/seek/volume/shuffle/next/previous/metadata - System tray with icon, playback controls, now-playing display, and minimize-to-tray behaviour; left-click toggles window visibility - Desktop notifications for track changes; configurable per NotificationConfig (enabled, show_artist, show_album flags) - File association handler: emits file-open event for audio files passed via CLI or OS "Open With"; handles startup argument - Auto-start support via tauri-plugin-autostart; persisted in config - AppConfig struct with window geometry, tray, notification, and autostart fields; persisted to JSON via load_config/save_config - Window state (size, position, maximised) saved on close/resize/move - Settings page with General, System, Notification, Audio, and About sections; all toggles wired to Tauri IPC commands - tauri.conf.json: fileAssociations for flac/mp3/m4a/m4b/ogg/opus/wav/aac - NixOS module: programs.harmonia-desktop option with desktop entry, D-Bus activation, and xdg.mime.defaultApplications
Contributor
|
Consider splitting into smaller PRs for easier review. Not a blocker, just a signal. |
This was referenced Mar 18, 2026
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.
Summary
#[cfg(target_os = "linux")]): bridgesPlaybackEnginebroadcast events to D-BusPropertiesChangedsignals viampris-server 0.8; supports play/pause/stop/seek/next/previous/volume/shuffle; metadata includes title, artist, album, duration, and track IDtray.set_menu()NotificationConfigflags (enabled,show_artist,show_album); additional helpers for download complete, request approved, and library scan eventshandle_startup_filechecks CLI args at launch for audio paths;handle_file_openemitsfile-openevent consumed by frontend;tauri.conf.jsondeclaresfileAssociationsfor flac/mp3/m4a/m4b/ogg/opus/wav/aactauri-plugin-autostartwired toautostart_is_enabled/autostart_setIPC commands; persisted inAppConfigAppConfig(window geometry, tray, notifications, autostart, start-minimized) serialised to~/.config/harmonia/config.json; window state saved on close/resize/moveprograms.harmonia-desktopoption; generatesxdg.desktopEntries.harmonia, D-Bus activation viaservices.dbus.packages, andxdg.mime.defaultApplicationsfor all registered audio typesTest plan
cd desktop && npm run lint— no warningscd desktop && npm run build— clean buildcd desktop/src-tauri && cargo check— no errorscd desktop/src-tauri && cargo clippy -- -D warnings— no warningsplayerctl listshowsharmoniaplayerctl play-pause/playerctl next/playerctl previouscontrol playbackplayerctl metadatareturns current track title, artist, albumplayerctl volume 0.5sets volume to 50 %notifications.enabled = falsexdg-open some-file.flacopens Harmonia and emitsfile-opennix-instantiate --parse nix/module.nixObservations
desktop/src-tauri/src/playback/podcast.rsandakroasis/shared/akroasis-core/have uncommitted changes from a prior session that are outside this PR's scope; left unstaged.TrayIcon<R>in Tauri 2 exposes nomenu()getter — the only update path is rebuilding and callingset_menu(); this means every track change rebuilds the full menu (7 items). Acceptable for now; aMenuItemhandle cache would allow targetedset_text()updates.mpris-server 0.8re-exportszbus 4.xasmpris_server::zbus; adding an explicitzbus = "5"dependency creates a type mismatch betweenzbus::fdo::Errorandmpris_server::zbus::fdo::Error. The Cargo.toml must not pin a separate zbus version.mpris:artUrlfield set). TheTrackInfostruct does not carry a cover URL; plumbing that through is a follow-up.