From 3f45a0b70bb2e99e8e452b5fb976aaf1f92299a4 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 4 Nov 2024 23:03:23 +0100 Subject: [PATCH 1/2] Export icons according to XDG icon spec on unix Signed-off-by: Matthew J. Milner --- avogadro/CMakeLists.txt | 12 +++++++++++- cmake/InstallLocation.cmake | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/avogadro/CMakeLists.txt b/avogadro/CMakeLists.txt index 59a1a88e..df2ce1e0 100644 --- a/avogadro/CMakeLists.txt +++ b/avogadro/CMakeLists.txt @@ -175,7 +175,17 @@ if(APPLE) elseif(UNIX) install(FILES "icons/org.openchemistry.Avogadro2.desktop" DESTINATION "${INSTALL_XDG_APPS_DIR}") install(FILES "icons/org.openchemistry.Avogadro2.metainfo.xml" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/metainfo") - install(FILES "icons/avogadro.png" DESTINATION "${INSTALL_XDG_ICON_DIR}" + install(FILES "icons/avogadro.png" DESTINATION "${INSTALL_XDG_ICON_DIR}/hicolor/32x32/apps" + RENAME "org.openchemistry.Avogadro2.png") + install(FILES "icons/avogadro.png" DESTINATION "${INSTALL_XDG_ICON_DIR}/hicolor/16x16@2/apps" + RENAME "org.openchemistry.Avogadro2.png") + install(FILES "icons/avogadro2_64.png" DESTINATION "${INSTALL_XDG_ICON_DIR}/hicolor/64x64/apps" + RENAME "org.openchemistry.Avogadro2.png") + install(FILES "icons/avogadro2_64.png" DESTINATION "${INSTALL_XDG_ICON_DIR}/hicolor/32x32@2/apps" + RENAME "org.openchemistry.Avogadro2.png") + install(FILES "icons/avogadro2_128.png" DESTINATION "${INSTALL_XDG_ICON_DIR}/hicolor/128x128/apps" + RENAME "org.openchemistry.Avogadro2.png") + install(FILES "icons/avogadro2_256.png" DESTINATION "${INSTALL_XDG_ICON_DIR}/hicolor/256x256/apps" RENAME "org.openchemistry.Avogadro2.png") elseif(WIN32) list(APPEND avogadro_srcs icons/avogadro.rc) diff --git a/cmake/InstallLocation.cmake b/cmake/InstallLocation.cmake index ca9e375a..f23c0c19 100644 --- a/cmake/InstallLocation.cmake +++ b/cmake/InstallLocation.cmake @@ -33,7 +33,7 @@ if(UNIX AND NOT APPLE) set(INSTALL_XDG_APPS_DIR "${INSTALL_DATA_DIR}/applications") endif() if(NOT INSTALL_XDG_ICON_DIR) - set(INSTALL_XDG_ICON_DIR "${INSTALL_DATA_DIR}/pixmaps") + set(INSTALL_XDG_ICON_DIR "${INSTALL_DATA_DIR}/icons") endif() endif() From fdc7f3a846a2f640c744cd98d1a8fc782a54ead9 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 4 Nov 2024 23:24:23 +0100 Subject: [PATCH 2/2] Add SVG icon and export as scalable icon Signed-off-by: Matthew J. Milner --- avogadro/CMakeLists.txt | 2 + avogadro/icons/avogadro2.svg | 106 +++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 avogadro/icons/avogadro2.svg diff --git a/avogadro/CMakeLists.txt b/avogadro/CMakeLists.txt index df2ce1e0..3aab6e2d 100644 --- a/avogadro/CMakeLists.txt +++ b/avogadro/CMakeLists.txt @@ -187,6 +187,8 @@ elseif(UNIX) RENAME "org.openchemistry.Avogadro2.png") install(FILES "icons/avogadro2_256.png" DESTINATION "${INSTALL_XDG_ICON_DIR}/hicolor/256x256/apps" RENAME "org.openchemistry.Avogadro2.png") + install(FILES "icons/avogadro2.svg" DESTINATION "${INSTALL_XDG_ICON_DIR}/hicolor/scalable/apps" + RENAME "org.openchemistry.Avogadro2.svg") elseif(WIN32) list(APPEND avogadro_srcs icons/avogadro.rc) endif() diff --git a/avogadro/icons/avogadro2.svg b/avogadro/icons/avogadro2.svg new file mode 100644 index 00000000..51737794 --- /dev/null +++ b/avogadro/icons/avogadro2.svg @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +