Skip to content

Commit 648bc60

Browse files
committed
Update Linux desktop file generation to fix app icon support
We were registering the wrong icon name in the desktop file.
1 parent 35783bc commit 648bc60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/SwiftBundler/Bundler/GenericLinuxBundler.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ enum GenericLinuxBundler: Bundler {
262262
return createDesktopFile(
263263
at: structure.desktopFile,
264264
appName: context.appName,
265+
iconName: structure.icon1024x1024.deletingPathExtension().lastPathComponent,
265266
appConfiguration: context.appConfiguration,
266267
installedExecutableLocation: executableLocation
267268
)
@@ -469,13 +470,16 @@ enum GenericLinuxBundler: Bundler {
469470
/// - Parameters:
470471
/// - desktopFile: The desktop file to create.
471472
/// - appName: The app's name.
473+
/// - iconName: The name of the icon (the icon's file name without the
474+
/// extension).
472475
/// - appConfiguration: The app's configuration.
473476
/// - installedExecutableLocation: The location the the executable will end
474477
/// up at on disk once installed.
475478
/// - Returns: If an error occurs, a failure is returned.
476479
private static func createDesktopFile(
477480
at desktopFile: URL,
478481
appName: String,
482+
iconName: String,
479483
appConfiguration: AppConfiguration.Flat,
480484
installedExecutableLocation: URL
481485
) -> Result<Void, GenericLinuxBundlerError> {
@@ -489,7 +493,7 @@ enum GenericLinuxBundler: Bundler {
489493
("Name", appName),
490494
("Comment", ""),
491495
("Exec", "\(escapedExecPath) %U"),
492-
("Icon", appName),
496+
("Icon", iconName),
493497
("Terminal", "false"),
494498
("Categories", ""),
495499
]

0 commit comments

Comments
 (0)