Better icons: device/app icon chains, volume icons, app icon (#2)
CI / check (push) Successful in 10s
CI / native (push) Successful in 1m10s

This commit was merged in pull request #2.
This commit is contained in:
nandi committed 2026-11-23 01:07:41 +00:00
1 parent f08f241edb
commit 02b08cb471
21 files changed
+658 -70

No files matched your search

+30 -1
View File
@@ -117,12 +117,41 @@ To install it for your user:
```sh
install -Dm755 _build/native/release/build/cmd/moonmix/moonmix.exe ~/.local/bin/moonmix
install -Dm644 data/org.latha.moonmix.desktop ~/.local/share/applications/org.latha.moonmix.desktop
install -Dm644 data/icons/hicolor/scalable/apps/org.latha.moonmix.svg ~/.local/share/icons/hicolor/scalable/apps/org.latha.moonmix.svg
install -Dm644 data/icons/hicolor/symbolic/apps/org.latha.moonmix-symbolic.svg ~/.local/share/icons/hicolor/symbolic/apps/org.latha.moonmix-symbolic.svg
gtk-update-icon-cache -f -t ~/.local/share/icons/hicolor # optional
```
The app icon is `org.latha.moonmix` (a speaker with a volume slider), shipped
as scalable and symbolic SVGs under `data/icons/hicolor/`. The window uses it
as its icon and the program name is `org.latha.moonmix`, which matches the
`.desktop` file so Wayland shells show it too. Run from a checkout, moonmix
also searches `./data/icons` and `$MOONMIX_ICON_DIR`.
### Icons
Everything else uses the desktop's icon theme (Adwaita, Breeze, Papirus...
any theme with the standard freedesktop names; install `adwaita-icon-theme`
if icons are missing). The names are chosen in `model/icons.mbt` and tested
with `moon test`; the GTK layer only asks the theme `has_icon`:
- **Devices**: the device's own `device.icon-name` / `node.icon-name`, then
`device.form-factor` (headphone, headset, speaker, microphone, webcam,
handset, tv, hdmi...), HDMI/webcam/Bluetooth/USB hints, then the direction
(speakers or microphone), then `audio-card-symbolic` and
`audio-x-generic-symbolic`. Symbolic variants are tried first so they follow
the theme's foreground colour. `image-missing` is the very last resort.
- **Streams**: `application.icon-name` / `media.icon-name`, then the app's
launcher icon found in the installed `.desktop` files (by
`pipewire.access.portal.app_id`, `application.process.binary` or
`application.name`), then `application-x-executable-symbolic`.
- **Mute button**: `audio-volume-high/medium/low/muted-symbolic` following the
volume and mute state. Row icons are 32 px, button and tab icons 16 px.
Pkg-config flags: moon does not expand `$(pkg-config ...)` in `moon.pkg`
link options. Instead, the packages point `link.native.stub-cc` and `cc` at
`tools/pkg-cc`, a wrapper that adds
`pkg-config --cflags --libs libpipewire-0.3 wireplumber-0.5 gtk4`. moon
`pkg-config --cflags --libs libpipewire-0.3 wireplumber-0.5 gtk4 gio-unix-2.0`. moon
derives the archiver name from the compiler name, so `tools/pkg-ar` is a
passthrough to `ar`. Set `MOONMIX_CC` or `MOONMIX_AR` to use another
compiler or archiver.