Skip to content

Commit f1b861e

Browse files
authored
fix(build): fix missing icon in the dock/dash of Linux DEs (#6303)
1 parent 5cde4ce commit f1b861e

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

HMCL/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ val makeDeb = tasks.register("makeDeb", CreateDeb::class) {
299299

300300
version.set(project.version.toString())
301301
releaseType.set(debChannel)
302+
launcherClassName.set("org.jackhuang.hmcl.Launcher")
302303
appShFile.set(layout.file(provider { artifactFile("sh") }))
303304
iconFile.set(layout.projectDirectory.file("image/hmcl.png"))
304305
outputFile.set(debFile)

buildSrc/src/main/java/org/jackhuang/hmcl/gradle/pack/CreateDeb.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ public abstract class CreateDeb extends DefaultTask {
7676
@Input
7777
public abstract Property<ReleaseType> getReleaseType();
7878

79+
/// Launcher class name for Linux StartupWMClass property in the .desktop file.
80+
@Input
81+
public abstract Property<String> getLauncherClassName();
82+
7983
/// Executable `.sh` artifact produced by `makeExecutables`.
8084
@InputFile
8185
public abstract RegularFileProperty getAppShFile();
@@ -295,6 +299,7 @@ private String getDesktopInfo() {
295299
StartupNotify=false
296300
Categories=Game;
297301
Keywords=mc;minecraft;
298-
""".formatted(getCurrentType().getDisplayName(), getLauncherPath(), getIconTargetPath());
302+
StartupWMClass=%s
303+
""".formatted(getCurrentType().getDisplayName(), getLauncherPath(), getIconTargetPath(), getLauncherClassName().get());
299304
}
300305
}

0 commit comments

Comments
 (0)