From 5db9854e63a6fe87dd3ebe9fd4c072188e7afc6f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 27 Feb 2023 15:20:31 -0800 Subject: [PATCH] build: install the proper linux desktop file depending on flatpak or not --- build.zig | 6 +++++- dist/linux/app-flatpak.desktop | 9 +++++++++ dist/linux/app.desktop | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 dist/linux/app-flatpak.desktop diff --git a/build.zig b/build.zig index 3032aa8d7..9ddc81aa4 100644 --- a/build.zig +++ b/build.zig @@ -154,7 +154,11 @@ pub fn build(b: *std.build.Builder) !void { // https://developer.gnome.org/documentation/guidelines/maintainer/integrating.html // Desktop file so that we have an icon and other metadata - b.installFile("dist/linux/app.desktop", "share/applications/com.mitchellh.ghostty.desktop"); + if (flatpak) { + b.installFile("dist/linux/app-flatpak.desktop", "share/applications/com.mitchellh.ghostty.desktop"); + } else { + b.installFile("dist/linux/app.desktop", "share/applications/com.mitchellh.ghostty.desktop"); + } // Various icons that our application can use, including the icon // that will be used for the desktop. diff --git a/dist/linux/app-flatpak.desktop b/dist/linux/app-flatpak.desktop new file mode 100644 index 000000000..99a005750 --- /dev/null +++ b/dist/linux/app-flatpak.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Ghostty +Type=Application +Comment=A terminal emulator +Exec=/app/bin/ghostty +Icon=com.mitchellh.ghostty +Keywords=terminal;tty;pty; +StartupNotify=true +Terminal=false diff --git a/dist/linux/app.desktop b/dist/linux/app.desktop index 99a005750..a06032d78 100644 --- a/dist/linux/app.desktop +++ b/dist/linux/app.desktop @@ -2,7 +2,7 @@ Name=Ghostty Type=Application Comment=A terminal emulator -Exec=/app/bin/ghostty +Exec=/usr/bin/ghostty Icon=com.mitchellh.ghostty Keywords=terminal;tty;pty; StartupNotify=true