From 9eb5072aa1877a7c4c204177a64ded7fe4e5c0a4 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 20 May 2021 06:26:21 +0200 Subject: [PATCH] Install app icon in XDG hicolor icon theme Install the icon of the application in the hicolor XDG icon theme; this way it can be properly loaded by XDG menus in the currently set XDG icon theme, without looking in the legacy pixmaps location. As result, adapt the desktop file by removing the full path to the icon (which was already buggy for installations in prefixes different than /usr), so the bare icon name will be searched in the XDG icon theme as expected. Also, remove the manual icon copying in a bundle script, as the icon is installed in the right place now. --- scripts/Linux/resources/make_bundle.sh | 2 -- scripts/Linux/resources/meshlab.desktop | 2 +- src/CMakeLists.txt | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/Linux/resources/make_bundle.sh b/scripts/Linux/resources/make_bundle.sh index 7dafa6980..d953a78cd 100644 --- a/scripts/Linux/resources/make_bundle.sh +++ b/scripts/Linux/resources/make_bundle.sh @@ -30,11 +30,9 @@ then fi mkdir -p $INSTALL_PATH/usr/share/doc/meshlab -mkdir -p $INSTALL_PATH/usr/share/icons/hicolor/512x512/apps/ mkdir -p $INSTALL_PATH/usr/share/icons/Yaru/512x512/apps/ cp $SCRIPTS_PATH/resources/meshlab_appimage.desktop $INSTALL_PATH/usr/share/applications/meshlab.desktop -cp $DISTRIB_PATH/meshlab.png $INSTALL_PATH/usr/share/icons/hicolor/512x512/apps/meshlab.png cp $DISTRIB_PATH/meshlab.png $INSTALL_PATH/usr/share/icons/Yaru/512x512/apps/meshlab.png cp $DISTRIB_PATH/LICENSE.txt $INSTALL_PATH/usr/share/doc/meshlab/ cp $DISTRIB_PATH/privacy.txt $INSTALL_PATH/usr/share/doc/meshlab/ diff --git a/scripts/Linux/resources/meshlab.desktop b/scripts/Linux/resources/meshlab.desktop index 44b5a09d7..253a6403b 100644 --- a/scripts/Linux/resources/meshlab.desktop +++ b/scripts/Linux/resources/meshlab.desktop @@ -7,7 +7,7 @@ GenericName[en_GB]=Mesh processing Comment=View and process meshes Type=Application Exec=meshlab %F -Icon=/usr/share/pixmaps/meshlab.png +Icon=meshlab Terminal=false MimeType=model/mesh;application/x-3ds;image/x-3ds;model/x-ply;application/sla;model/x-quad-object;model/x-geomview-off;application/x-cyclone-ptx;application/x-vmi;application/x-bre;model/vnd.collada+xml;model/openctm;application/x-expe-binary;application/x-expe-ascii;application/x-xyz;application/x-gts;chemical/x-pdb;application/x-tri;application/x-asc;model/x3d+xml;model/x3d+vrml;model/vrml;model/u3d;model/idtf; Categories=Graphics;3DGraphics;Viewer;Qt; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 22d8ad439..c0de78dc8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -272,7 +272,7 @@ if (NOT BUILD_ONLY_MESHLAB_LIBRARIES) if(NOT WIN32 AND NOT APPLE) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/Linux/resources/meshlab.desktop" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/meshlab.png" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/meshlab.png" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps) endif() endif()