diff --git a/dist/linux/com.mitchellh.ghostty.metainfo.xml b/dist/linux/com.mitchellh.ghostty.metainfo.xml index 0424d3a09..46b370bb8 100644 --- a/dist/linux/com.mitchellh.ghostty.metainfo.xml +++ b/dist/linux/com.mitchellh.ghostty.metainfo.xml @@ -1,7 +1,7 @@ - com.mitchellh.ghostty - com.mitchellh.ghostty.desktop + com.mitchellh.ghostty@@DEBUG@@ + com.mitchellh.ghostty@@DEBUG@@.desktop Ghostty https://ghostty.org https://ghostty.org/docs diff --git a/flatpak/com.mitchellh.ghostty-debug.yml b/flatpak/com.mitchellh.ghostty-debug.yml index 8a2c0056e..fe4722ef5 100644 --- a/flatpak/com.mitchellh.ghostty-debug.yml +++ b/flatpak/com.mitchellh.ghostty-debug.yml @@ -6,11 +6,7 @@ sdk-extensions: - org.freedesktop.Sdk.Extension.ziglang default-branch: tip command: ghostty -# Integrate the rename into zig build, maybe? -rename-desktop-file: com.mitchellh.ghostty.desktop -rename-appdata-file: com.mitchellh.ghostty.metainfo.xml rename-icon: com.mitchellh.ghostty -desktop-file-name-suffix: " (Debug)" finish-args: # 3D rendering - --device=dri diff --git a/src/build/GhosttyResources.zig b/src/build/GhosttyResources.zig index f3b169de1..f72006b4b 100644 --- a/src/build/GhosttyResources.zig +++ b/src/build/GhosttyResources.zig @@ -258,15 +258,34 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources { ), ); // systemd user service + if (!cfg.flatpak) + try steps.append( + formatService( + b, + cfg, + b.path("dist/linux/systemd.service"), + b.fmt( + "{s}/systemd/user/com.mitchellh.ghostty{s}.service", + .{ + if (cfg.system_package) "lib" else "share", + switch (cfg.optimize) { + .Debug, .ReleaseSafe => "-debug", + .ReleaseFast, .ReleaseSmall => "", + }, + }, + ), + ), + ); + + // AppStream metainfo so that application has rich metadata within app stores try steps.append( formatService( b, cfg, - b.path("dist/linux/systemd.service"), + b.path("dist/linux/com.mitchellh.ghostty.metainfo.xml"), b.fmt( - "{s}/systemd/user/com.mitchellh.ghostty{s}.service", + "share/metainfo/com.mitchellh.ghostty{s}.metainfo.xml", .{ - if (cfg.system_package) "lib" else "share", switch (cfg.optimize) { .Debug, .ReleaseSafe => "-debug", .ReleaseFast, .ReleaseSmall => "", @@ -276,12 +295,6 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources { ), ); - // AppStream metainfo so that application has rich metadata within app stores - try steps.append(&b.addInstallFile( - b.path("dist/linux/com.mitchellh.ghostty.metainfo.xml"), - "share/metainfo/com.mitchellh.ghostty.metainfo.xml", - ).step); - // Right click menu action for Plasma desktop try steps.append(&b.addInstallFile( b.path("dist/linux/ghostty_dolphin.desktop"), @@ -360,7 +373,7 @@ pub fn formatService(b: *std.Build, cfg: *const Config, src: std.Build.LazyPath, "-e s!@@NAME@@!{s}!g", .{ switch (cfg.optimize) { - .Debug, .ReleaseSafe => " Debug", + .Debug, .ReleaseSafe => " (Debug)", .ReleaseFast, .ReleaseSmall => "", }, }, @@ -378,6 +391,8 @@ pub fn formatService(b: *std.Build, cfg: *const Config, src: std.Build.LazyPath, "-e s!@@GHOSTTY@@!{s}/bin/ghostty!g", .{b.install_prefix}, )); + if (cfg.flatpak) + cmd.addArg("-e /^SystemdService=/d"); return &b.addInstallFile(output, dest).step; }