diff --git a/patches/SimPaM-v0.6.11-to-v0.6.12-icon.patch b/patches/SimPaM-v0.6.11-to-v0.6.12-icon.patch new file mode 100644 index 0000000..4b1f8ef --- /dev/null +++ b/patches/SimPaM-v0.6.11-to-v0.6.12-icon.patch @@ -0,0 +1,457 @@ +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -1,6 +1,6 @@ + [package] + name = "patient-monitor-simulation" +-version = "0.6.11" ++version = "0.6.12" + edition = "2021" + license = "MIT" + description = "Synthetic patient-monitor simulation for teaching (not for clinical use)" +--- /dev/null ++++ b/FLATPAK-ICON.md +@@ -0,0 +1,42 @@ ++# SimPaM application icon / Flatpak integration ++ ++The original CCCA SVG has been placed on a **square transparent canvas** without changing or stretching its artwork. The icon is shipped as `data/icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg`. ++ ++The Rust build script embeds it as a GLib resource, allowing the GTK application to display the icon even when launched with `cargo run`. The Flatpak desktop icon must **also** be installed to `/app/share/icons`; GTK resources alone are not visible to the host's launcher. ++ ++## Integrate the existing Flatpak manifest ++ ++In the existing manifest `at.criticalcare.SimPaM.yml`, keep its current `app-id: at.criticalcare.SimPaM`, `command: patient-monitor-simulation`, GNOME 51 SDK/runtime and PulseAudio permission. Add **one command** to the same module's `build-commands` list, after the executable's installation: ++ ++```yaml ++ - sh scripts/install-flatpak-assets.sh ++``` ++ ++This installs the desktop entry, AppStream metadata, and scalable icon. The manifest's local directory source must include `data/` and `scripts/`; the existing `type: dir` with `path: .` ordinarily does. ++ ++**Do not install or bundle `pw-play` or `paplay`**. The native PulseAudio backend remains unchanged. ++ ++No new Rust dependencies were added. The icon embedding build script uses `glib-compile-resources`, which is provided by GLib development tools (Fedora: `glib2-devel`). In a GNOME SDK it is normally already available. ++ ++## Rebuild and check ++ ++From the directory containing `at.criticalcare.SimPaM.yml`, with the Cargo lockfile updated to the current package version: ++ ++```sh ++cargo check ++flatpak-builder --force-clean --repo=flatpak-repo build-flatpak at.criticalcare.SimPaM.yml ++flatpak build-bundle flatpak-repo "SimPaM-0.6.12-x86_64.flatpak" at.criticalcare.SimPaM --arch=x86_64 --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo ++``` ++ ++Since no Rust dependencies changed, you do not need to regenerate `cargo-sources.json` solely for the icon. If that file or the lockfile is out of sync from previous changes, regenerate them as usual. ++ ++## Files ++ ++- `data/icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg` — square scalable icon ++- `data/at.criticalcare.SimPaM.desktop` — launcher entry ++- `data/at.criticalcare.SimPaM.metainfo.xml` — AppStream application metadata ++- `data/simpam.gresource.xml` — resource path for GTK windows ++- `build.rs` — creates the embedded GLib resource ++- `scripts/install-flatpak-assets.sh` — installs launcher, metadata and icon in Flatpak ++ ++The source artwork was supplied by Critical Care Club Austria; its reuse and distribution rights are separate from the Rust source-code license. +--- a/README.de.md ++++ b/README.de.md +@@ -1,4 +1,4 @@ +-# SimPaM — Patientenmonitor-Simulation v0.6.11 ++# SimPaM — Patientenmonitor-Simulation v0.6.12 + + Der in Rust/GTK4 entwickelte **SimPaM** simuliert einen Patientenmonitor + für die Lehre unter Fedora Linux. Die Anwendung besitzt ein **Admin-Fenster** +@@ -687,6 +687,18 @@ + `flatpak-cargo-generator` neu erzeugt werden. Das vorhandene Flatpak-Manifest + wird gesondert gepflegt und ist nicht Teil dieser Quellcodeänderung. + ++### Programmsymbol und Desktop-Integration (v0.6.12) ++ ++Das bereitgestellte CCCA-Logo dient als Programmsymbol von SimPaM. Es wird für ++die Monitor- und Admin-Fenster, den Linux-Anwendungsstarter und den Flatpak-Export ++verwendet. Das skalierbare SVG liegt auf einer quadratischen Zeichenfläche unter ++`data/icons/hicolor/scalable/apps/`. Über `build.rs` wird es auch bei direktem ++Start mit Cargo als GTK-Ressource bereitgestellt. ++ ++Die einmalige Ergänzung des vorhandenen Flatpak-Manifests sowie die ++Paketierungsbefehle sind in [FLATPAK-ICON.md](FLATPAK-ICON.md) dokumentiert. ++Es sind keine neuen Rust-Crates oder Flatpak-Berechtigungen erforderlich. ++ + ## Changelog + + ### Änderungen seit v0.2.2 +@@ -883,3 +895,11 @@ + selektive zweiminütige Alarmpause bleiben erhalten. Der Testton ist auch bei + deaktivierten akustischen Alarmen verfügbar. In Flatpak werden die + PulseAudio-Socket-Berechtigung und `libpulse-simple` benötigt. ++ ++### v0.6.12 – Programmsymbol und Desktop-Metadaten ++ ++Das bereitgestellte CCCA-SVG wurde als quadratisches, skalierbares Programmsymbol ++integriert. GTK bindet es für den lokalen Cargo-Start ein. Für Flatpak wurden ++Desktop-Datei und AppStream-Metadaten unter `at.criticalcare.SimPaM` ergänzt. ++Ein Installationsskript und Paketierungshinweise wurden hinzugefügt; die ++Simulation und die Audioausgabe bleiben unverändert. +--- a/README.md ++++ b/README.md +@@ -1,4 +1,4 @@ +-# SimPaM — Patient Monitor Simulation v0.6.11 ++# SimPaM — Patient Monitor Simulation v0.6.12 + + A Rust/GTK4 patient-monitor simulator with two main windows for teaching on Fedora Linux. + +@@ -695,6 +695,17 @@ + contains application sources; an existing Flatpak manifest is maintained + separately and was not modified by this update. + ++### Application icon and desktop integration (v0.6.12) ++ ++The CCCA logo is used as SimPaM's application icon. It appears on the monitor ++and Admin windows, the Linux desktop launcher, and Flatpak exports. The source ++image is stored as a square, scalable SVG in `data/icons/hicolor/scalable/apps/`. ++A GTK resource compiled by `build.rs` supplies the icon for direct Cargo runs. ++ ++See [FLATPAK-ICON.md](FLATPAK-ICON.md) for the one-line addition needed in your ++existing Flatpak manifest and for packaging commands. No new Cargo crates or ++new Flatpak permissions are required. ++ + ## Changelog + + ### Changes since v0.2.2 +@@ -887,3 +898,11 @@ + controls, alarm priorities and selective alarm-pause logic are retained. + A manual test tone remains available with audible alarms switched off. + Flatpak requires the PulseAudio socket and `libpulse-simple` in its SDK/runtime. ++ ++### v0.6.12 — Application icon and desktop metadata ++ ++Added the supplied CCCA SVG as a square, scalable application icon. GTK embeds ++it for local Cargo launches, and Flatpak assets include a matching desktop ++entry and AppStream metadata under `at.criticalcare.SimPaM`. Added a small ++Flatpak asset installer and packaging instructions; the physiological ++simulation and audio backend are unchanged. +--- /dev/null ++++ b/build.rs +@@ -0,0 +1,20 @@ ++//! Embed the desktop icon for `cargo run` as well as Flatpak builds. ++//! `glib-compile-resources` is provided by the GLib development tools. ++use std::{env, path::PathBuf, process::Command}; ++ ++fn main() { ++ println!("cargo:rerun-if-changed=data/simpam.gresource.xml"); ++ println!("cargo:rerun-if-changed=data/icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg"); ++ ++ let source_root = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR") ++ .expect("Cargo must provide CARGO_MANIFEST_DIR")); ++ let target = PathBuf::from(env::var_os("OUT_DIR") ++ .expect("Cargo must provide OUT_DIR")).join("simpam.gresource"); ++ let result = Command::new("glib-compile-resources") ++ .arg(source_root.join("data/simpam.gresource.xml")) ++ .arg(format!("--sourcedir={}", source_root.join("data").display())) ++ .arg(format!("--target={}", target.display())) ++ .status() ++ .expect("glib-compile-resources is required (install glib2-devel on Fedora)"); ++ assert!(result.success(), "failed to compile SimPaM icon resources"); ++} +--- /dev/null ++++ b/data/at.criticalcare.SimPaM.desktop +@@ -0,0 +1,12 @@ ++[Desktop Entry] ++Type=Application ++Name=SimPaM ++GenericName=Patient Monitor Simulator ++GenericName[de]=Patientenmonitor-Simulator ++Comment=Simulated patient monitor for medical teaching ++Comment[de]=Patientenmonitor-Simulation für die medizinische Lehre ++Exec=patient-monitor-simulation ++Icon=at.criticalcare.SimPaM ++Terminal=false ++Categories=Education;Science; ++StartupNotify=true +--- /dev/null ++++ b/data/at.criticalcare.SimPaM.metainfo.xml +@@ -0,0 +1,21 @@ ++ ++ ++ at.criticalcare.SimPaM ++ CC0-1.0 ++ MIT ++ SimPaM ++ Patient monitor simulation for teaching ++ Patientenmonitor-Simulation für die Lehre ++ ++

SimPaM displays synthetic ECG, pulse oximetry, invasive arterial pressure, capnography and non-invasive blood pressure for educational simulations.

++

Instructors can change physiology, trigger clinical scenarios, and use interactive alarms and patient-monitor controls. SimPaM is not a medical device and must not be used for clinical decisions.

++
++ at.criticalcare.SimPaM.desktop ++ ++ Education ++ Science ++ ++ ++ ++ ++
+--- /dev/null ++++ b/data/icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg +@@ -0,0 +1,220 @@ ++ ++ ++ ++image/svg+xml ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ b/data/simpam.gresource.xml +@@ -0,0 +1,6 @@ ++ ++ ++ ++ icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg ++ ++ +--- /dev/null ++++ b/scripts/install-flatpak-assets.sh +@@ -0,0 +1,9 @@ ++#!/bin/sh ++# Run from the Cargo project root during the Flatpak module's build commands. ++# Deliberately separate from the executable installation. ++set -eu ++prefix="${1:-/app}" ++id='at.criticalcare.SimPaM' ++install -Dm644 "data/${id}.desktop" "${prefix}/share/applications/${id}.desktop" ++install -Dm644 "data/${id}.metainfo.xml" "${prefix}/share/metainfo/${id}.metainfo.xml" ++install -Dm644 "data/icons/hicolor/scalable/apps/${id}.svg" "${prefix}/share/icons/hicolor/scalable/apps/${id}.svg" +--- a/src/main.rs ++++ b/src/main.rs +@@ -10,4 +10,7 @@ + use gtk::prelude::*; + + fn main() -> gtk::glib::ExitCode { ++ // GTK finds the icon for Cargo launches without a system-wide install. ++ gtk::gio::resources_register_include!("simpam.gresource") ++ .expect("failed to register SimPaM icon resources"); + let application = gtk::Application::builder() +@@ -15,4 +18,7 @@ + .build(); +- application.connect_activate(ui::create_windows); ++ application.connect_activate(|app| { ++ gtk::Window::set_default_icon_name("at.criticalcare.SimPaM"); ++ ui::create_windows(app); ++ }); + application.run() + } diff --git a/patient-monitor-simulation/Cargo.lock b/patient-monitor-simulation/Cargo.lock index 0a9ecde..ceda20c 100644 --- a/patient-monitor-simulation/Cargo.lock +++ b/patient-monitor-simulation/Cargo.lock @@ -506,7 +506,7 @@ dependencies = [ [[package]] name = "patient-monitor-simulation" -version = "0.6.11" +version = "0.6.12" dependencies = [ "gtk4", "libpulse-binding", diff --git a/patient-monitor-simulation/Cargo.toml b/patient-monitor-simulation/Cargo.toml index c19e486..416eddc 100644 --- a/patient-monitor-simulation/Cargo.toml +++ b/patient-monitor-simulation/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patient-monitor-simulation" -version = "0.6.11" +version = "0.6.12" edition = "2021" license = "MIT" description = "Synthetic patient-monitor simulation for teaching (not for clinical use)" diff --git a/patient-monitor-simulation/FLATPAK-ICON.md b/patient-monitor-simulation/FLATPAK-ICON.md new file mode 100644 index 0000000..eb17d3d --- /dev/null +++ b/patient-monitor-simulation/FLATPAK-ICON.md @@ -0,0 +1,42 @@ +# SimPaM application icon / Flatpak integration + +The original CCCA SVG has been placed on a **square transparent canvas** without changing or stretching its artwork. The icon is shipped as `data/icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg`. + +The Rust build script embeds it as a GLib resource, allowing the GTK application to display the icon even when launched with `cargo run`. The Flatpak desktop icon must **also** be installed to `/app/share/icons`; GTK resources alone are not visible to the host's launcher. + +## Integrate the existing Flatpak manifest + +In the existing manifest `at.criticalcare.SimPaM.yml`, keep its current `app-id: at.criticalcare.SimPaM`, `command: patient-monitor-simulation`, GNOME 51 SDK/runtime and PulseAudio permission. Add **one command** to the same module's `build-commands` list, after the executable's installation: + +```yaml + - sh scripts/install-flatpak-assets.sh +``` + +This installs the desktop entry, AppStream metadata, and scalable icon. The manifest's local directory source must include `data/` and `scripts/`; the existing `type: dir` with `path: .` ordinarily does. + +**Do not install or bundle `pw-play` or `paplay`**. The native PulseAudio backend remains unchanged. + +No new Rust dependencies were added. The icon embedding build script uses `glib-compile-resources`, which is provided by GLib development tools (Fedora: `glib2-devel`). In a GNOME SDK it is normally already available. + +## Rebuild and check + +From the directory containing `at.criticalcare.SimPaM.yml`, with the Cargo lockfile updated to the current package version: + +```sh +cargo check +flatpak-builder --force-clean --repo=flatpak-repo build-flatpak at.criticalcare.SimPaM.yml +flatpak build-bundle flatpak-repo "SimPaM-0.6.12-x86_64.flatpak" at.criticalcare.SimPaM --arch=x86_64 --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo +``` + +Since no Rust dependencies changed, you do not need to regenerate `cargo-sources.json` solely for the icon. If that file or the lockfile is out of sync from previous changes, regenerate them as usual. + +## Files + +- `data/icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg` — square scalable icon +- `data/at.criticalcare.SimPaM.desktop` — launcher entry +- `data/at.criticalcare.SimPaM.metainfo.xml` — AppStream application metadata +- `data/simpam.gresource.xml` — resource path for GTK windows +- `build.rs` — creates the embedded GLib resource +- `scripts/install-flatpak-assets.sh` — installs launcher, metadata and icon in Flatpak + +The source artwork was supplied by Critical Care Club Austria; its reuse and distribution rights are separate from the Rust source-code license. diff --git a/patient-monitor-simulation/README.de.md b/patient-monitor-simulation/README.de.md index 457310f..47f6545 100644 --- a/patient-monitor-simulation/README.de.md +++ b/patient-monitor-simulation/README.de.md @@ -1,4 +1,4 @@ -# SimPaM — Patientenmonitor-Simulation v0.6.11 +# SimPaM — Patientenmonitor-Simulation v0.6.12 Der in Rust/GTK4 entwickelte **SimPaM** simuliert einen Patientenmonitor für die Lehre unter Fedora Linux. Die Anwendung besitzt ein **Admin-Fenster** @@ -687,6 +687,18 @@ Nach dem Aktualisieren von `Cargo.lock` muss `cargo-sources.json` mit `flatpak-cargo-generator` neu erzeugt werden. Das vorhandene Flatpak-Manifest wird gesondert gepflegt und ist nicht Teil dieser Quellcodeänderung. +### Programmsymbol und Desktop-Integration (v0.6.12) + +Das bereitgestellte CCCA-Logo dient als Programmsymbol von SimPaM. Es wird für +die Monitor- und Admin-Fenster, den Linux-Anwendungsstarter und den Flatpak-Export +verwendet. Das skalierbare SVG liegt auf einer quadratischen Zeichenfläche unter +`data/icons/hicolor/scalable/apps/`. Über `build.rs` wird es auch bei direktem +Start mit Cargo als GTK-Ressource bereitgestellt. + +Die einmalige Ergänzung des vorhandenen Flatpak-Manifests sowie die +Paketierungsbefehle sind in [FLATPAK-ICON.md](FLATPAK-ICON.md) dokumentiert. +Es sind keine neuen Rust-Crates oder Flatpak-Berechtigungen erforderlich. + ## Changelog ### Änderungen seit v0.2.2 @@ -883,3 +895,11 @@ sättigungsabhängige QRS-Töne, Stummschaltung, Alarmprioritäten und die selektive zweiminütige Alarmpause bleiben erhalten. Der Testton ist auch bei deaktivierten akustischen Alarmen verfügbar. In Flatpak werden die PulseAudio-Socket-Berechtigung und `libpulse-simple` benötigt. + +### v0.6.12 – Programmsymbol und Desktop-Metadaten + +Das bereitgestellte CCCA-SVG wurde als quadratisches, skalierbares Programmsymbol +integriert. GTK bindet es für den lokalen Cargo-Start ein. Für Flatpak wurden +Desktop-Datei und AppStream-Metadaten unter `at.criticalcare.SimPaM` ergänzt. +Ein Installationsskript und Paketierungshinweise wurden hinzugefügt; die +Simulation und die Audioausgabe bleiben unverändert. diff --git a/patient-monitor-simulation/README.md b/patient-monitor-simulation/README.md index 30ee6f0..2d7c275 100644 --- a/patient-monitor-simulation/README.md +++ b/patient-monitor-simulation/README.md @@ -1,4 +1,4 @@ -# SimPaM — Patient Monitor Simulation v0.6.11 +# SimPaM — Patient Monitor Simulation v0.6.12 A Rust/GTK4 patient-monitor simulator with two main windows for teaching on Fedora Linux. @@ -695,6 +695,17 @@ using `flatpak-cargo-generator` before building offline. The project archive contains application sources; an existing Flatpak manifest is maintained separately and was not modified by this update. +### Application icon and desktop integration (v0.6.12) + +The CCCA logo is used as SimPaM's application icon. It appears on the monitor +and Admin windows, the Linux desktop launcher, and Flatpak exports. The source +image is stored as a square, scalable SVG in `data/icons/hicolor/scalable/apps/`. +A GTK resource compiled by `build.rs` supplies the icon for direct Cargo runs. + +See [FLATPAK-ICON.md](FLATPAK-ICON.md) for the one-line addition needed in your +existing Flatpak manifest and for packaging commands. No new Cargo crates or +new Flatpak permissions are required. + ## Changelog ### Changes since v0.2.2 @@ -887,3 +898,11 @@ The existing two-tone alarm sounds, SpO₂-dependent QRS tones, rhythms, mute controls, alarm priorities and selective alarm-pause logic are retained. A manual test tone remains available with audible alarms switched off. Flatpak requires the PulseAudio socket and `libpulse-simple` in its SDK/runtime. + +### v0.6.12 — Application icon and desktop metadata + +Added the supplied CCCA SVG as a square, scalable application icon. GTK embeds +it for local Cargo launches, and Flatpak assets include a matching desktop +entry and AppStream metadata under `at.criticalcare.SimPaM`. Added a small +Flatpak asset installer and packaging instructions; the physiological +simulation and audio backend are unchanged. diff --git a/patient-monitor-simulation/at.criticalcare.SimPaM.yml b/patient-monitor-simulation/at.criticalcare.SimPaM.yml index cf8838e..c71de50 100644 --- a/patient-monitor-simulation/at.criticalcare.SimPaM.yml +++ b/patient-monitor-simulation/at.criticalcare.SimPaM.yml @@ -40,6 +40,8 @@ modules: target/release/patient-monitor-simulation /app/bin/patient-monitor-simulation + - sh scripts/install-flatpak-assets.sh + - install -Dm644 at.criticalcare.SimPaM.desktop /app/share/applications/at.criticalcare.SimPaM.desktop diff --git a/patient-monitor-simulation/build.rs b/patient-monitor-simulation/build.rs new file mode 100644 index 0000000..d1ed774 --- /dev/null +++ b/patient-monitor-simulation/build.rs @@ -0,0 +1,20 @@ +//! Embed the desktop icon for `cargo run` as well as Flatpak builds. +//! `glib-compile-resources` is provided by the GLib development tools. +use std::{env, path::PathBuf, process::Command}; + +fn main() { + println!("cargo:rerun-if-changed=data/simpam.gresource.xml"); + println!("cargo:rerun-if-changed=data/icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg"); + + let source_root = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR") + .expect("Cargo must provide CARGO_MANIFEST_DIR")); + let target = PathBuf::from(env::var_os("OUT_DIR") + .expect("Cargo must provide OUT_DIR")).join("simpam.gresource"); + let result = Command::new("glib-compile-resources") + .arg(source_root.join("data/simpam.gresource.xml")) + .arg(format!("--sourcedir={}", source_root.join("data").display())) + .arg(format!("--target={}", target.display())) + .status() + .expect("glib-compile-resources is required (install glib2-devel on Fedora)"); + assert!(result.success(), "failed to compile SimPaM icon resources"); +} diff --git a/patient-monitor-simulation/data/at.criticalcare.SimPaM.desktop b/patient-monitor-simulation/data/at.criticalcare.SimPaM.desktop new file mode 100644 index 0000000..801c14f --- /dev/null +++ b/patient-monitor-simulation/data/at.criticalcare.SimPaM.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +Name=SimPaM +GenericName=Patient Monitor Simulator +GenericName[de]=Patientenmonitor-Simulator +Comment=Simulated patient monitor for medical teaching +Comment[de]=Patientenmonitor-Simulation für die medizinische Lehre +Exec=patient-monitor-simulation +Icon=at.criticalcare.SimPaM +Terminal=false +Categories=Education;Science; +StartupNotify=true diff --git a/patient-monitor-simulation/data/at.criticalcare.SimPaM.metainfo.xml b/patient-monitor-simulation/data/at.criticalcare.SimPaM.metainfo.xml new file mode 100644 index 0000000..ad984ae --- /dev/null +++ b/patient-monitor-simulation/data/at.criticalcare.SimPaM.metainfo.xml @@ -0,0 +1,24 @@ + + + at.criticalcare.SimPaM + CC0-1.0 + MIT + SimPaM + + Critical Care Club Austria + + Patient monitor simulation for teaching + Patientenmonitor-Simulation für die Lehre + +

SimPaM displays synthetic ECG, pulse oximetry, invasive arterial pressure, capnography and non-invasive blood pressure for educational simulations.

+

Instructors can change physiology, trigger clinical scenarios, and use interactive alarms and patient-monitor controls. SimPaM is not a medical device and must not be used for clinical decisions.

+
+ at.criticalcare.SimPaM.desktop + + Education + Science + + + + +
diff --git a/patient-monitor-simulation/data/simpam.gresource.xml b/patient-monitor-simulation/data/simpam.gresource.xml new file mode 100644 index 0000000..0d1709d --- /dev/null +++ b/patient-monitor-simulation/data/simpam.gresource.xml @@ -0,0 +1,6 @@ + + + + icons/hicolor/scalable/apps/at.criticalcare.SimPaM.svg + + diff --git a/patient-monitor-simulation/scripts/install-flatpak-assets.sh b/patient-monitor-simulation/scripts/install-flatpak-assets.sh new file mode 100644 index 0000000..89183b9 --- /dev/null +++ b/patient-monitor-simulation/scripts/install-flatpak-assets.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Run from the Cargo project root during the Flatpak module's build commands. +# Deliberately separate from the executable installation. +set -eu +prefix="${1:-/app}" +id='at.criticalcare.SimPaM' +install -Dm644 "data/${id}.desktop" "${prefix}/share/applications/${id}.desktop" +install -Dm644 "data/${id}.metainfo.xml" "${prefix}/share/metainfo/${id}.metainfo.xml" +install -Dm644 "data/icons/hicolor/scalable/apps/${id}.svg" "${prefix}/share/icons/hicolor/scalable/apps/${id}.svg" diff --git a/patient-monitor-simulation/src/main.rs b/patient-monitor-simulation/src/main.rs index f563c1e..0f57e80 100644 --- a/patient-monitor-simulation/src/main.rs +++ b/patient-monitor-simulation/src/main.rs @@ -10,9 +10,15 @@ mod ui; use gtk::prelude::*; fn main() -> gtk::glib::ExitCode { + // GTK finds the icon for Cargo launches without a system-wide install. + gtk::gio::resources_register_include!("simpam.gresource") + .expect("failed to register SimPaM icon resources"); let application = gtk::Application::builder() .application_id("at.criticalcare.SimPaM") .build(); - application.connect_activate(ui::create_windows); + application.connect_activate(|app| { + gtk::Window::set_default_icon_name("at.criticalcare.SimPaM"); + ui::create_windows(app); + }); application.run() }