From 38c9f0bebf478a7a55d26a3a044873c5f59c7d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20M=C3=A1t=C3=A9=20R=C3=B3bert?= Date: Tue, 8 Nov 2022 13:49:34 +0100 Subject: [PATCH] GH-4966 Refactor the desktop entry Changed the desktop file icon lookup, to enable app icon theming. The Icon line uses the icon name instead of the full path. For this to work, the icon is moved to a directory specified by the standard (`/usr/share/icons/hicolor/scalable/apps/`). As the standard highly suggests, a 48x48 png icon is also added (rendered from the svg with inkscape). Added the `StartupWMClass` directive, so that window managers can associate the created windows with the desktop icon. Changed the rpm spec file to reflect the aforementioned changes. Fixes #4966 --- launcher/package/rpm/MultiMC5.spec | 10 ++++++++-- .../usr/share/applications/multimc.desktop | 3 ++- .../share/icons/hicolor/48x48/apps/multimc.png | Bin 0 -> 3663 bytes .../icons/hicolor/scalable/apps/multimc.svg} | 0 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 launcher/package/ubuntu/multimc/usr/share/icons/hicolor/48x48/apps/multimc.png rename launcher/package/ubuntu/multimc/{opt/multimc/icon.svg => usr/share/icons/hicolor/scalable/apps/multimc.svg} (100%) diff --git a/launcher/package/rpm/MultiMC5.spec b/launcher/package/rpm/MultiMC5.spec index 4b7e5002fd..f6cad878d4 100644 --- a/launcher/package/rpm/MultiMC5.spec +++ b/launcher/package/rpm/MultiMC5.spec @@ -26,8 +26,11 @@ A local install wrapper for MultiMC %install mkdir -p %{buildroot}/opt/multimc -install -m 0644 ../ubuntu/multimc/opt/multimc/icon.svg %{buildroot}/opt/multimc/icon.svg install -m 0755 ../ubuntu/multimc/opt/multimc/run.sh %{buildroot}/opt/multimc/run.sh +mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps +install -m 0644 ../ubuntu/multimc/usr/share/icons/hicolor/48x48/apps/multimc.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/multimc.png +mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/scalable/apps +install -m 0644 ../ubuntu/multimc/usr/share/icons/hicolor/scalable/apps/multimc.svg %{buildroot}/%{_datadir}/icons/hicolor/scalable/apps/multimc.svg mkdir -p %{buildroot}/%{_datadir}/applications desktop-file-install --dir=%{buildroot}%{_datadir}/applications ../ubuntu/multimc/usr/share/applications/multimc.desktop @@ -41,8 +44,11 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/multimc.metain %files %dir /opt/multimc -/opt/multimc/icon.svg /opt/multimc/run.sh +%dir %{_datadir}/icons/hicolor/48x48/apps +%{_datadir}/icons/hicolor/48x48/apps/multimc.png +%dir %{_datadir}/icons/hicolor/scalable/apps +%{_datadir}/icons/hicolor/scalable/apps/multimc.svg %{_datadir}/applications/multimc.desktop %{_metainfodir}/multimc.metainfo.xml %dir %{_mandir}/man1 diff --git a/launcher/package/ubuntu/multimc/usr/share/applications/multimc.desktop b/launcher/package/ubuntu/multimc/usr/share/applications/multimc.desktop index e0456f896b..c7a58c30a0 100644 --- a/launcher/package/ubuntu/multimc/usr/share/applications/multimc.desktop +++ b/launcher/package/ubuntu/multimc/usr/share/applications/multimc.desktop @@ -1,12 +1,13 @@ [Desktop Entry] Categories=Game; Exec=/opt/multimc/run.sh -Icon=/opt/multimc/icon.svg +Icon=multimc Keywords=game;Minecraft; MimeType= Name=MultiMC 5 Path= StartupNotify=true +StartupWMClass=org.multimc.MultiMC Terminal=false TerminalOptions= Type=Application diff --git a/launcher/package/ubuntu/multimc/usr/share/icons/hicolor/48x48/apps/multimc.png b/launcher/package/ubuntu/multimc/usr/share/icons/hicolor/48x48/apps/multimc.png new file mode 100644 index 0000000000000000000000000000000000000000..654fe24d4ffdd8cb08d44fc8226380f59f8a8b15 GIT binary patch literal 3663 zcmV-V4zTfwP)(^b8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H14ctjY zK~!jg#hFQrW!G89f9Krkz5AxBS5sGywsCvFiS1w$VhIu=5+NsG#AuK}0tu7_3j{k>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