Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpui: disable soulvaki on linux

+77 -2
+3 -1
gpui/Cargo.toml
··· 26 26 tonic-reflection = "0.12.3" 27 27 tonic-web = "0.12.3" 28 28 http = "1.4.0" 29 - souvlaki = "0.8" 30 29 mdns-sd = "0.5.9" 30 + 31 + [target.'cfg(not(target_os = "linux"))'.dependencies] 32 + souvlaki = "0.8" 31 33 32 34 [build-dependencies] 33 35 tonic-build = "0.12.3"
+48 -1
gpui/package.sh
··· 1 1 #!/usr/bin/env bash 2 - # package.sh — build a release binary, create Rockbox.app, and wrap it in a DMG 2 + # package.sh — build a release binary and package for macOS or Linux 3 3 set -euo pipefail 4 4 5 5 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ··· 15 15 DMG_STAGING="${OUT_DIR}/dmg_staging" 16 16 DMG_OUT="${OUT_DIR}/${APP_NAME}.dmg" 17 17 18 + # ── Detect OS ───────────────────────────────────────────────────────────────── 19 + OS="$(uname -s)" 20 + case "$OS" in 21 + Linux*) OS_TYPE="Linux";; 22 + Darwin*) OS_TYPE="macOS";; 23 + *) echo "Unsupported OS: $OS" && exit 1;; 24 + esac 25 + 26 + echo "▸ Detected OS: $OS_TYPE" 27 + 18 28 # ── 1. Build ────────────────────────────────────────────────────────────────── 19 29 echo "▸ Building release binary…" 20 30 cargo build --release 31 + 32 + if [ "$OS_TYPE" = "Linux" ]; then 33 + # ── Linux Package ───────────────────────────────────────────────────────── 34 + echo "▸ Creating Linux package structure…" 35 + rm -rf "$OUT_DIR" 36 + mkdir -p "${OUT_DIR}/usr/bin" 37 + mkdir -p "${OUT_DIR}/usr/share/applications" 38 + mkdir -p "${OUT_DIR}/usr/share/pixmaps" 39 + 40 + echo "▸ Copying binary to ${OUT_DIR}/usr/bin/…" 41 + cp "$BINARY" "${OUT_DIR}/usr/bin/rockbox-gpui" 42 + chmod +x "${OUT_DIR}/usr/bin/rockbox-gpui" 43 + 44 + echo "▸ Copying app icon…" 45 + cp "${APPICONSET}/256.png" "${OUT_DIR}/usr/share/pixmaps/rockbox-gpui.png" 46 + 47 + echo "▸ Creating desktop entry…" 48 + cat > "${OUT_DIR}/usr/share/applications/rockbox-gpui.desktop" <<DESKTOP 49 + [Desktop Entry] 50 + Name=Rockbox GPUI 51 + Comment=Modern audio player with multi-room support 52 + Exec=rockbox-gpui 53 + Icon=rockbox-gpui 54 + Terminal=false 55 + Type=Application 56 + Categories=AudioVideo;Audio;Player; 57 + DESKTOP 58 + 59 + echo "" 60 + echo "✓ Linux package created in ${OUT_DIR}/" 61 + echo " Binary: ${OUT_DIR}/usr/bin/rockbox-gpui" 62 + echo " Desktop: ${OUT_DIR}/usr/share/applications/rockbox-gpui.desktop" 63 + echo " Icon: ${OUT_DIR}/usr/share/pixmaps/rockbox-gpui.png" 64 + exit 0 65 + fi 66 + 67 + # ── macOS Package ───────────────────────────────────────────────────────────── 21 68 22 69 # ── 2. Build .icns from the Xcode project's appiconset PNGs ────────────────── 23 70 echo "▸ Building app icon from Xcode appiconset…"
+26
gpui/src/now_playing.rs
··· 1 1 use crate::state::{PlaybackStatus, Track}; 2 + #[cfg(not(target_os = "linux"))] 2 3 use souvlaki::{ 3 4 MediaControlEvent, MediaControls, MediaMetadata, MediaPlayback, MediaPosition, PlatformConfig, 4 5 }; 6 + #[cfg(not(target_os = "linux"))] 5 7 use std::sync::mpsc; 6 8 use std::time::Duration; 7 9 ··· 20 22 /// Must be created on the main thread (macOS requires MPRemoteCommandCenter 21 23 /// registration on the main thread). The GPUI foreground poll loop — also on 22 24 /// the main thread — calls `drain_commands` and `update` each tick. 25 + #[cfg(not(target_os = "linux"))] 23 26 pub struct NowPlayingManager { 24 27 controls: MediaControls, 25 28 cmd_rx: mpsc::Receiver<MediaCommand>, ··· 29 32 last_cover_url: Option<String>, 30 33 } 31 34 35 + /// Stub implementation for Linux (souvlaki disabled). 36 + #[cfg(target_os = "linux")] 37 + pub struct NowPlayingManager; 38 + 39 + #[cfg(not(target_os = "linux"))] 32 40 impl NowPlayingManager { 33 41 /// Returns `None` if the OS media-control API is unavailable. 34 42 pub fn new() -> Option<Self> { ··· 153 161 let _ = self.controls.set_playback(playback); 154 162 } 155 163 } 164 + 165 + #[cfg(target_os = "linux")] 166 + impl NowPlayingManager { 167 + /// Returns `None` — media controls disabled on Linux. 168 + pub fn new() -> Option<Self> { 169 + None 170 + } 171 + 172 + /// Drain all pending OS media-key commands (non-blocking). 173 + pub fn drain_commands(&mut self) -> Vec<MediaCommand> { 174 + Vec::new() 175 + } 176 + 177 + /// Push the current playback state and track metadata to the OS. 178 + pub fn update(&mut self, _track: Option<&Track>, _status: PlaybackStatus, _position: u64) { 179 + // No-op on Linux 180 + } 181 + }