New icon for Linux GTK app that aligns with the Gnome HIG (#8038)

This adds a new icon for the GTK-based application that adheres (mostly)
to the Gnome Human Interface Guidelines (HIG). The icon is designed to
fit in better with other Gnome applications.

While there isn't a single standard "native" style amongst Linux
applications, I believe this better fits the general Linux desktop
ecosystem over our macOS icon.

The icon itself is undeniably Ghostty. The core design language is the
same and I don't think ayone will mistake it for anything else. I wanted
to keep the brand the same, but making it fit in better aligns with
Ghostty's goal of being "platform native".

As of this PR, you can't use the macOS icon on Linux without modifying
the source. We may provide a compile-time option to swap icons in the
future (unfortunately Linux desktop applications require hardcoding an
icon path in the desktop files, so making it runtime selectable is...
messy!)

<img width="2048" height="2048" alt="2048"
src="https://github.com/user-attachments/assets/0b15e6db-bb6d-424c-8a83-ca809759b0c4"
/>
This commit is contained in:
Mitchell Hashimoto
2025-07-23 10:06:19 -07:00
committed by GitHub
11 changed files with 20 additions and 20 deletions

BIN
images/gnome/1024.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

BIN
images/gnome/128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/gnome/16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

BIN
images/gnome/2048.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 KiB

BIN
images/gnome/256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
images/gnome/32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
images/gnome/512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

BIN
images/gnome/64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -63,8 +63,8 @@ pub const file_inputs = deps: {
var deps: [total][]const u8 = undefined; var deps: [total][]const u8 = undefined;
var index: usize = 0; var index: usize = 0;
for (icon_sizes) |size| { for (icon_sizes) |size| {
deps[index] = std.fmt.comptimePrint("images/icons/icon_{d}.png", .{size}); deps[index] = std.fmt.comptimePrint("images/gnome/{d}.png", .{size});
deps[index + 1] = std.fmt.comptimePrint("images/icons/icon_{d}@2x.png", .{size}); deps[index + 1] = std.fmt.comptimePrint("images/gnome/{d}.png", .{size * 2});
index += 2; index += 2;
} }
for (blueprints) |bp| { for (blueprints) |bp| {
@ -162,7 +162,7 @@ fn genIcons(writer: anytype) !void {
// 1x // 1x
{ {
const alias = std.fmt.comptimePrint("{d}x{d}", .{ size, size }); const alias = std.fmt.comptimePrint("{d}x{d}", .{ size, size });
const source = std.fmt.comptimePrint("images/icons/icon_{d}.png", .{size}); const source = std.fmt.comptimePrint("images/gnome/{d}.png", .{size});
try cwd.access(source, .{}); try cwd.access(source, .{});
try writer.print( try writer.print(
\\ <file alias="{s}/apps/{s}.png">{s}</file> \\ <file alias="{s}/apps/{s}.png">{s}</file>
@ -175,7 +175,7 @@ fn genIcons(writer: anytype) !void {
// 2x // 2x
{ {
const alias = std.fmt.comptimePrint("{d}x{d}@2", .{ size, size }); const alias = std.fmt.comptimePrint("{d}x{d}@2", .{ size, size });
const source = std.fmt.comptimePrint("images/icons/icon_{d}@2x.png", .{size}); const source = std.fmt.comptimePrint("images/gnome/{d}.png", .{size * 2});
try cwd.access(source, .{}); try cwd.access(source, .{});
try writer.print( try writer.print(
\\ <file alias="{s}/apps/{s}.png">{s}</file> \\ <file alias="{s}/apps/{s}.png">{s}</file>

View File

@ -17,7 +17,7 @@ const icons = [_]struct {
}, },
.{ .{
.alias = "16x16@2", .alias = "16x16@2",
.source = "16@2x", .source = "32",
}, },
.{ .{
.alias = "32x32", .alias = "32x32",
@ -25,7 +25,7 @@ const icons = [_]struct {
}, },
.{ .{
.alias = "32x32@2", .alias = "32x32@2",
.source = "32@2x", .source = "64",
}, },
.{ .{
.alias = "128x128", .alias = "128x128",
@ -33,7 +33,7 @@ const icons = [_]struct {
}, },
.{ .{
.alias = "128x128@2", .alias = "128x128@2",
.source = "128@2x", .source = "256",
}, },
.{ .{
.alias = "256x256", .alias = "256x256",
@ -41,7 +41,7 @@ const icons = [_]struct {
}, },
.{ .{
.alias = "256x256@2", .alias = "256x256@2",
.source = "256@2x", .source = "512",
}, },
.{ .{
.alias = "512x512", .alias = "512x512",
@ -116,7 +116,7 @@ pub fn main() !void {
); );
for (icons) |icon| { for (icons) |icon| {
try writer.print( try writer.print(
" <file alias=\"{s}/apps/com.mitchellh.ghostty.png\">images/icons/icon_{s}.png</file>\n", " <file alias=\"{s}/apps/com.mitchellh.ghostty.png\">images/gnome/{s}.png</file>\n",
.{ icon.alias, icon.source }, .{ icon.alias, icon.source },
); );
} }
@ -153,7 +153,7 @@ pub const dependencies = deps: {
index += 1; index += 1;
} }
for (icons) |icon| { for (icons) |icon| {
deps[index] = std.fmt.comptimePrint("images/icons/icon_{s}.png", .{icon.source}); deps[index] = std.fmt.comptimePrint("images/gnome/{s}.png", .{icon.source});
index += 1; index += 1;
} }
for (blueprint_files) |blueprint_file| { for (blueprint_files) |blueprint_file| {

View File

@ -360,47 +360,47 @@ fn addLinuxAppResources(
// Various icons that our application can use, including the icon // Various icons that our application can use, including the icon
// that will be used for the desktop. // that will be used for the desktop.
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_16.png"), b.path("images/gnome/16.png"),
"share/icons/hicolor/16x16/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/16x16/apps/com.mitchellh.ghostty.png",
).step); ).step);
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_32.png"), b.path("images/gnome/32.png"),
"share/icons/hicolor/32x32/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/32x32/apps/com.mitchellh.ghostty.png",
).step); ).step);
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_128.png"), b.path("images/gnome/128.png"),
"share/icons/hicolor/128x128/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/128x128/apps/com.mitchellh.ghostty.png",
).step); ).step);
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_256.png"), b.path("images/gnome/256.png"),
"share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png",
).step); ).step);
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_512.png"), b.path("images/gnome/512.png"),
"share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png",
).step); ).step);
// Flatpaks only support icons up to 512x512. // Flatpaks only support icons up to 512x512.
if (!cfg.flatpak) { if (!cfg.flatpak) {
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_1024.png"), b.path("images/gnome/1024.png"),
"share/icons/hicolor/1024x1024/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/1024x1024/apps/com.mitchellh.ghostty.png",
).step); ).step);
} }
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_16@2x.png"), b.path("images/gnome/32.png"),
"share/icons/hicolor/16x16@2/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/16x16@2/apps/com.mitchellh.ghostty.png",
).step); ).step);
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_32@2x.png"), b.path("images/gnome/64.png"),
"share/icons/hicolor/32x32@2/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/32x32@2/apps/com.mitchellh.ghostty.png",
).step); ).step);
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_128@2x.png"), b.path("images/gnome/256.png"),
"share/icons/hicolor/128x128@2/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/128x128@2/apps/com.mitchellh.ghostty.png",
).step); ).step);
try steps.append(&b.addInstallFile( try steps.append(&b.addInstallFile(
b.path("images/icons/icon_256@2x.png"), b.path("images/gnome/512.png"),
"share/icons/hicolor/256x256@2/apps/com.mitchellh.ghostty.png", "share/icons/hicolor/256x256@2/apps/com.mitchellh.ghostty.png",
).step); ).step);
} }