Embed SVG assets and rasterise with resvg
All checks were successful
Mirror to GitHub / mirror (push) Successful in 1m28s
Build and publish package / package (push) Successful in 2m40s

The packaged binary panicked on startup ("svg load: Unrecognized image file
format"): asset SVGs were referenced by their build-time CARGO_MANIFEST_DIR
path (absent on an installed system, so read_to_string returned empty bytes),
and gdk::Texture::from_bytes can no longer decode SVG since librsvg dropped its
gdk-pixbuf loader.

- include_str! the SVGs into the binary (no runtime asset files)
- rasterise via resvg/tiny-skia into a gdk::MemoryTexture (no system loader)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Breadway 2026-06-14 19:36:38 +08:00
parent 60fef9751e
commit ae39fb3ce6
4 changed files with 317 additions and 28 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "breadbar"
version = "0.1.2"
version = "0.1.5"
edition = "2021"
description = "Minimal status bar and notification daemon for Hyprland on Wayland"
license = "MIT"
@ -20,6 +20,9 @@ zbus = { version = "5", default-features = false, features = ["tokio"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time", "process", "signal", "sync"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Pure-Rust SVG rasteriser (default features off → no text/font deps; the icons
# are vector-only). Needed because librsvg dropped its gdk-pixbuf SVG loader.
resvg = { version = "0.44", default-features = false }
[profile.release]
lto = "thin"