add: desktop entry, metadata, app name, icons

This commit is contained in:
2026-08-27 22:01:13 -04:00
parent 53d58fcb7e
commit 2f4cfe51b7
5 changed files with 180 additions and 6 deletions
+11
View File
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=SNES Patcher
GenericName=ROM Patcher
Comment=Apply IPS and BPS patches to Super Nintendo ROMs
Exec=snespatcher
Icon=com.wyattjmiller.snespatcher
Terminal=false
Categories=Utility;
Keywords=SNES;ROM;IPS;BPS;Patch;
StartupNotify=true
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.wyattjmiller.snespatcher</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MPL-2.0</project_license>
<name>SNES Patcher</name>
<summary>Apply IPS and BPS patches to Super Nintendo ROMs</summary>
<description>
<p>
SNES Patcher creates patched copies of Super Nintendo ROMs
while preserving the original file.
</p>
</description>
<launchable type="desktop-id">
com.wyattjmiller.snespatcher.desktop
</launchable>
<url type="homepage">
https://scm.wyattjmiller.com/wymiller/snespatcher
</url>
<content_rating type="oars-1.1"/>
</component>
@@ -0,0 +1,102 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256">
<defs>
<linearGradient id="body" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#565b66"/>
<stop offset="1" stop-color="#353944"/>
</linearGradient>
<linearGradient id="panel" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#4b505b"/>
<stop offset="1" stop-color="#373b45"/>
</linearGradient>
<linearGradient id="gold" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#ffd36a"/>
<stop offset="1" stop-color="#e9a834"/>
</linearGradient>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="150%">
<feDropShadow dx="0" dy="5" stdDeviation="5" flood-color="#000" flood-opacity=".28"/>
</filter>
<filter id="arrowShadow" x="-30%" y="-30%" width="160%" height="160%">
<feDropShadow dx="0" dy="2" stdDeviation="2" flood-color="#000" flood-opacity=".35"/>
</filter>
</defs>
<!-- Cartridge -->
<g filter="url(#shadow)">
<!-- main shell -->
<path d="
M55 26
Q44 26 39 33
Q35 39 35 49
L35 72
Q35 79 29 84
L24 88
L24 100
L30 104
Q35 108 35 116
L35 190
Q35 203 44 212
Q51 220 63 220
L193 220
Q205 220 212 212
Q221 203 221 190
L221 116
Q221 108 226 104
L232 100
L232 88
L227 84
Q221 79 221 72
L221 49
Q221 39 216 33
Q211 26 200 26
Z"
fill="url(#body)" stroke="#2b2e36" stroke-width="5" stroke-linejoin="round"/>
<!-- top grooves -->
<rect x="61" y="49" width="134" height="7" rx="3.5" fill="#292d35"/>
<rect x="61" y="63" width="134" height="7" rx="3.5" fill="#292d35"/>
<!-- center inset -->
<rect x="64" y="88" width="128" height="101" rx="15"
fill="#30343d" stroke="#252932" stroke-width="5"/>
<rect x="70" y="94" width="116" height="89" rx="11"
fill="url(#panel)" stroke="#626874" stroke-width="2"/>
<!-- tiny triangle notch -->
<path d="M118 194 L138 194 L128 205 Z" fill="#252932"/>
<!-- gold contacts -->
<rect x="61" y="207" width="134" height="23" rx="4"
fill="url(#gold)" stroke="#7e581c" stroke-width="3"/>
<g stroke="#b77920" stroke-width="3">
<line x1="78" y1="208" x2="78" y2="229"/>
<line x1="95" y1="208" x2="95" y2="229"/>
<line x1="112" y1="208" x2="112" y2="229"/>
<line x1="129" y1="208" x2="129" y2="229"/>
<line x1="146" y1="208" x2="146" y2="229"/>
<line x1="163" y1="208" x2="163" y2="229"/>
<line x1="180" y1="208" x2="180" y2="229"/>
</g>
</g>
<!-- down arrow -->
<path d="
M119 112
Q119 106 125 106
L131 106
Q137 106 137 112
L137 144
L151 130
Q155 126 159 130
L164 135
Q168 139 164 143
L132 175
Q128 179 124 175
L92 143
Q88 139 92 135
L97 130
Q101 126 105 130
L119 144
Z"
fill="#f2f2f2" stroke="#d7d7d7" stroke-width="2" stroke-linejoin="round"
filter="url(#arrowShadow)"/>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

+36 -6
View File
@@ -3,7 +3,8 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: outputs =
{ self, nixpkgs }:
let let
supportedSystems = [ supportedSystems = [
"x86_64-linux" "x86_64-linux"
@@ -12,7 +13,16 @@
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in in
{ {
packages = forAllSystems (system: formatter = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.nixfmt-rfc-style
);
packages = forAllSystems (
system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in in
@@ -23,7 +33,8 @@
src = pkgs.lib.cleanSourceWith { src = pkgs.lib.cleanSourceWith {
src = ./.; src = ./.;
filter = path: type: filter =
path: type:
let let
name = baseNameOf path; name = baseNameOf path;
in in
@@ -47,6 +58,20 @@
gtk4 gtk4
]; ];
postInstall = ''
install -Dm444 \
data/com.wyattjmiller.snespatcher.desktop \
$out/share/applications/com.wyattjmiller.snespatcher.desktop
install -Dm444 \
data/com.wyattjmiller.snespatcher.metainfo.xml \
$out/share/metainfo/com.wyattjmiller.snespatcher.metainfo.xml
install -Dm444 \
data/icons/hicolor/scalable/apps/com.wyattjmiller.snespatcher.svg \
$out/share/icons/hicolor/scalable/apps/com.wyattjmiller.snespatcher.svg
'';
meta = { meta = {
description = "GTK 4 application for applying IPS patches to SNES ROMs"; description = "GTK 4 application for applying IPS patches to SNES ROMs";
homepage = "https://scm.wyattjmiller.com/wymiller/snespatcher"; homepage = "https://scm.wyattjmiller.com/wymiller/snespatcher";
@@ -57,9 +82,11 @@
}; };
default = snespatcher; default = snespatcher;
}); }
);
devShells = forAllSystems (system: devShells = forAllSystems (
system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in in
@@ -72,8 +99,11 @@
clippy clippy
rustc rustc
rustfmt rustfmt
desktop-file-utils
appstream
]; ];
}; };
}); }
);
}; };
} }
+4
View File
@@ -16,6 +16,7 @@ use gtk4::{
}; };
const APP_ID: &str = "com.wyattjmiller.snespatcher"; const APP_ID: &str = "com.wyattjmiller.snespatcher";
const APP_NAME: &str = "SNES Patcher";
#[derive(Clone)] #[derive(Clone)]
struct SelectionState { struct SelectionState {
@@ -31,6 +32,7 @@ struct SelectionRow {
} }
fn main() { fn main() {
glib::set_application_name(APP_NAME);
let app = Application::new(Some(APP_ID), Default::default()); let app = Application::new(Some(APP_ID), Default::default());
app.connect_activate(build_ui); app.connect_activate(build_ui);
app.run(); app.run();
@@ -194,6 +196,8 @@ fn build_header_bar(
about.connect_activate(glib::clone!(@weak window => move |_, _| { about.connect_activate(glib::clone!(@weak window => move |_, _| {
let dialog = AboutDialog::builder() let dialog = AboutDialog::builder()
.transient_for(&window) .transient_for(&window)
.program_name(APP_NAME)
.logo_icon_name(APP_ID)
.modal(true) .modal(true)
.program_name("SNES Patcher") .program_name("SNES Patcher")
.version(env!("CARGO_PKG_VERSION")) .version(env!("CARGO_PKG_VERSION"))