Skip to content

Commit

Permalink
MultiMCGH-4966 Refactor the desktop entry
Browse files Browse the repository at this point in the history
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 MultiMC#4966
  • Loading branch information
mrmeszaros committed Nov 8, 2022
1 parent 301b44d commit 38c9f0b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions launcher/package/rpm/MultiMC5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 38c9f0b

Please sign in to comment.