一个基于 GPUI 与 DTK 的本地/在线音乐播放器,界面使用 dtk-gpui v0.1.1 控件库实现,应用框架基于 gpui-kit 0.11。
A local and online music player built with gpui-kit and the dtk-gpui v0.1.1 widget library.
Romus 是一个面向 Linux 桌面的音乐播放器:本地曲库、播放列表和播放状态保存在本机,同时可选接入网易云音乐,浏览发现页、歌单和收藏内容。窗口框架、标题栏、侧边栏与常规控件由 DTK 控件绘制,并跟随系统的浅色/深色配色;四种主题播放区由 GPUI 自绘。
- DTK 窗口框架、标题栏与侧边栏
- 五种播放区风格:经典(紧凑播放条)、水墨、赛博、夜店、蒸汽波;主播放区与浮动迷你播放器共用同一套视觉
- 本地曲库导入,歌曲/专辑/艺术家浏览与搜索
- 播放列表创建、重命名、删除,喜欢(收藏)与播放队列管理
- 内嵌元数据、封面与 LRC 歌词解析(逐行/逐字时间、结束时间、翻译与 offset)
- “正在播放”详情页:大封面、播放控制与可点击跳转的歌词
- 播放队列与歌词侧边面板
- 浮动迷你播放器:可置顶、记忆位置,透明度可在配置中调整
- 登录账号后,启动时恢复上次的播放队列与进度;主窗口位置和大小会被记住
- Linux MPRIS 媒体状态,可被桌面面板和媒体键识别
- 网易云音乐发现页、歌单、收藏歌单与喜欢的歌曲
- 二维码登录与游客模式;试听歌曲会显示“试听”标记
- 简体中文 / English 界面,可在设置中即时切换或跟随系统
- 浅色、深色与跟随系统三种配色
需要 Linux(X11 或 Wayland)、Rust 工具链,以及 GPUI 和音频输出所需的系统开发库。以 Debian/Deepin 为例:
sudo apt install build-essential pkg-config libasound2-dev libfontconfig1-dev \
libfreetype-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb1-dev \
libxkbcommon-dev libxkbcommon-x11-dev
cargo run --release启动后通过界面导入本地音频或 LRC 文件。
首次启动时,Romus 会以 config.toml.example 为模板生成 ~/.config/romus/config.toml。常用设置包括:
language:auto(跟随系统)、en或zh-CNtheme:auto、light或darkplayer_theme:classic、ink、cyber(默认)、dj或vapor[online]:隐藏无权限的 VIP 歌曲、网易云音质[playback] resume_session:登录后启动时恢复队列与进度[window]、[mini_player]:窗口/迷你播放器位置、置顶与透明度[logging]:日志目录、级别与轮转
界面语言默认跟随系统(LANGUAGE / LC_ALL / LC_MESSAGES / LANG),可在 设置 → 语言 即时切换;配色和播放区风格可在 设置 → 外观 与 设置 → 播放区 修改。选择会写回配置文件。
| 内容 | 位置 |
|---|---|
| 客户端配置 | ~/.config/romus/config.toml |
| 曲库与播放列表 | ~/.config/romus/library.toml |
| 网易云账号会话(权限 0600) | ~/.config/romus/online.toml |
| 播放队列与进度 | ~/.local/state/romus/playback.json |
| 日志 | ~/.local/state/romus/logs |
| 播放列表封面缓存 | ~/.cache/romus/playlist-covers |
| 在线歌曲播放缓存 | ~/.cache/romus/online/v2 |
| 喜欢/收藏歌曲的本地副本 | ~/.local/share/romus/online |
在线音乐是可选功能。未登录时可以游客身份浏览发现页与歌单;部分歌曲只提供 30 秒试听,播放器会显示“试听”标记。登录后可同步喜欢的歌曲与收藏歌单,账号会话只保存在本机。
仓库包含 debian/ 打包配置。安装好上面列出的构建依赖和 debhelper 后:
sudo apt install debhelper
dpkg-buildpackage -us -uc -b
sudo apt install ../romus_*.deb如果 Rust 由 rustup 提供、没有对应的 cargo / rustc 发行版包,可加 -d 跳过 Build-Depends 检查(其余构建依赖仍需手动安装);如果 dh_strip 处理 release 二进制时报错,可改用:
DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -us -uc -b -dapps/android 是独立的 Cargo 包,提供移动端布局的演示与 Android 构建配置,构建和预览方式见 apps/android/README.md。
gpui-kit 使用 crates.io 的 0.11.0;dtk-gpui 通过远端 git 依赖引入并固定 revision,以保证可复现:
gpui-kit = "0.11.0"
dtk-gpui = { git = "https://github.com/re2zero/dtk-gpui.git", rev = "002e2b41f5b957067000500789d54d11b6d79bfa" }音频播放与异步运行时分别由仓库内的 src/audio(cpal + symphonia)和 src/runtime.rs(Tokio 桥接)实现。
Romus is a Linux desktop music player. The local library, playlists, and playback state stay on the machine, while optional NetEase Cloud Music integration adds discovery, playlists, and saved content. The window frame, title bar, sidebar, and standard widgets are drawn with DTK widgets and follow the system light/dark palette; the four themed player stages are painted directly with GPUI.
- DTK window frame, title bar, and sidebar
- Five player-area styles: Classic (compact bar), Ink wash, Neon pulse, Club, and Vaporwave, shared by the main player and the floating mini player
- Local library import with songs, albums, artists, and search
- Playlist create/rename/delete, favorites, and play-queue management
- Embedded metadata, artwork, and LRC lyrics (line/word timing, end times, translations, and offset)
- Now Playing detail page with large artwork, transport controls, and click-to-seek lyrics
- Queue and lyrics side panels
- Floating mini player with always-on-top, remembered position, and configurable opacity
- Restores the last queue and playback position at launch when signed in, and remembers the main-window geometry
- Linux MPRIS integration for desktop panels and media keys
- NetEase Cloud Music discovery, playlists, saved playlists, and liked songs
- QR-code sign-in and guest mode, with a “Trial” badge for preview-only tracks
- English and Simplified Chinese UI, switchable in Settings or following the system locale
- Light, dark, and follow-system color schemes
You need Linux (X11 or Wayland), a Rust toolchain, and the system development libraries required by GPUI and audio output. On Debian/Deepin:
sudo apt install build-essential pkg-config libasound2-dev libfontconfig1-dev \
libfreetype-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb1-dev \
libxkbcommon-dev libxkbcommon-x11-dev
cargo run --releaseAfter startup, import local audio or LRC files through the interface.
On first launch Romus creates ~/.config/romus/config.toml from config.toml.example. Common settings:
language:auto(follow the system locale),en, orzh-CNtheme:auto,light, ordarkplayer_theme:classic,ink,cyber(default),dj, orvapor[online]: hide restricted VIP tracks and choose the NetEase stream quality[playback] resume_session: restore the queue and position on launch when signed in[window],[mini_player]: window/mini-player position, always-on-top, and opacity[logging]: log directory, filter, and rotation
The UI language follows the system locale (LANGUAGE / LC_ALL / LC_MESSAGES / LANG) by default and can be switched live in Settings → Language. Change the color scheme and player style in Settings → Appearance and Settings → Player area; the choice is written back to the config file.
| Item | Location |
|---|---|
| Client config | ~/.config/romus/config.toml |
| Library and playlists | ~/.config/romus/library.toml |
| NetEase account session (mode 0600) | ~/.config/romus/online.toml |
| Play queue and position | ~/.local/state/romus/playback.json |
| Logs | ~/.local/state/romus/logs |
| Playlist cover cache | ~/.cache/romus/playlist-covers |
| Online playback cache | ~/.cache/romus/online/v2 |
| Local copies of liked/saved tracks | ~/.local/share/romus/online |
Online music is optional. Guest browsing covers discovery and playlists. Some tracks are limited to a 30-second preview and are marked “Trial”. Signing in syncs liked songs and saved playlists, and the account session stays on the local machine.
The repository includes Debian packaging under debian/. With the build dependencies above and debhelper installed:
sudo apt install debhelper
dpkg-buildpackage -us -uc -b
sudo apt install ../romus_*.debAdd -d when Rust comes from rustup and the distro cargo / rustc packages are absent, to skip the Build-Depends check (install the other build dependencies manually). If dh_strip fails on the release binary, use:
DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -us -uc -b -dapps/android is a standalone Cargo package with the mobile layout demo and Android build configuration. See apps/android/README.md for build and preview instructions.
gpui-kit comes from crates.io at 0.11.0; dtk-gpui is pulled in as a remote git dependency pinned to a revision for reproducible builds:
gpui-kit = "0.11.0"
dtk-gpui = { git = "https://github.com/re2zero/dtk-gpui.git", rev = "002e2b41f5b957067000500789d54d11b6d79bfa" }Audio playback and the async runtime live in this repository (src/audio using cpal + symphonia, and src/runtime.rs as the Tokio bridge).
本项目采用 MIT License。
This project is available under the MIT License.