From 4062b95c5773d437fa13a3d33f05f60a3aa9ecc7 Mon Sep 17 00:00:00 2001 From: NotCoded <66999075+not-coded@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:33:12 +0200 Subject: [PATCH] make app not show up in applications --- .../java/net/notcoded/wayfix/util/DesktopFileInjector.java | 3 ++- .../assets/wayfix/com.mojang.minecraft.java-edition.desktop | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java b/src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java index 02d87d0..b1e25d8 100644 --- a/src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java +++ b/src/main/java/net/notcoded/wayfix/util/DesktopFileInjector.java @@ -39,9 +39,10 @@ public static void inject() { try (InputStream stream = DesktopFileInjector.class.getResourceAsStream(RESOURCE_LOCATION)) { Path location = getDesktopFileLocation(); + String desktop = System.getenv("XDG_CURRENT_DESKTOP"); String version = MinecraftClient.getInstance().getGameVersion(); injectFile(location, String.format(IOUtils.toString(Objects.requireNonNull(stream), StandardCharsets.UTF_8), - version, ICON_NAME.substring(0, ICON_NAME.lastIndexOf("."))).getBytes(StandardCharsets.UTF_8)); + version, ICON_NAME.substring(0, ICON_NAME.lastIndexOf(".")), !desktop.contains("GNOME") ? "Hidden=true" : "").getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { WayFix.LOGGER.error("Failed to inject icon: ", e); } diff --git a/src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop b/src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop index c654e7e..c3c3cf6 100644 --- a/src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop +++ b/src/main/resources/assets/wayfix/com.mojang.minecraft.java-edition.desktop @@ -5,4 +5,5 @@ Icon=%s Exec=true Terminal=false Type=Application -Categories=Game; \ No newline at end of file +Categories=Game; +%s \ No newline at end of file