From a02da356ba272e4041f1b8d77bd74d208de8fd1f Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 18 Apr 2022 20:10:10 +0200 Subject: [PATCH] Make Nheko discoverable using appdata --- CMakeLists.txt | 28 ++++++++++++------- io.github.NhekoReborn.Nheko.yaml | 3 -- ...nheko.appdata.xml => nheko.appdata.xml.in} | 7 ++++- resources/nheko.desktop | 2 ++ 4 files changed, 26 insertions(+), 14 deletions(-) rename resources/{nheko.appdata.xml => nheko.appdata.xml.in} (93%) diff --git a/CMakeLists.txt b/CMakeLists.txt index eef3d829..a8b1f11b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -732,19 +732,27 @@ endif() set_target_properties(nheko PROPERTIES CMAKE_SKIP_INSTALL_RPATH TRUE) if(UNIX AND NOT APPLE) + if(FLATPAK) + set(APPID "io.github.NhekoReborn.Nheko") + else() + set(APPID "nheko") + endif() + install (TARGETS nheko RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - install (FILES "resources/nheko-16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "nheko.png") - install (FILES "resources/nheko-32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "nheko.png") - install (FILES "resources/nheko-48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "nheko.png") - install (FILES "resources/nheko-64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "nheko.png") - install (FILES "resources/nheko-128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "nheko.png") - install (FILES "resources/nheko-256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "nheko.png") - install (FILES "resources/nheko-512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "nheko.png") - install (FILES "resources/nheko.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps" RENAME "nheko.svg") - install (FILES "resources/nheko.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") - install (FILES "resources/nheko.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") + install (FILES "resources/nheko-16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "${APPID}.png") + install (FILES "resources/nheko-32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "${APPID}.png") + install (FILES "resources/nheko-48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "${APPID}.png") + install (FILES "resources/nheko-64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "${APPID}.png") + install (FILES "resources/nheko-128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "${APPID}.png") + install (FILES "resources/nheko-256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "${APPID}.png") + install (FILES "resources/nheko-512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "${APPID}.png") + install (FILES "resources/nheko.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps" RENAME "${APPID}.svg") + install (FILES "resources/nheko.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" RENAME "${APPID}.desktop") install (FILES "resources/_nheko" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/zsh/site-functions") + configure_file("resources/nheko.appdata.xml.in" "resources/nheko.appdata.xml" @ONLY) + install (FILES "resources/nheko.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo" RENAME "${APPID}.appdata.xml") + if(NOT TARGET uninstall) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" diff --git a/io.github.NhekoReborn.Nheko.yaml b/io.github.NhekoReborn.Nheko.yaml index d634a9a2..ac16be72 100644 --- a/io.github.NhekoReborn.Nheko.yaml +++ b/io.github.NhekoReborn.Nheko.yaml @@ -3,9 +3,6 @@ command: nheko runtime: org.kde.Platform runtime-version: '5.15-21.08' sdk: org.kde.Sdk -rename-icon: nheko -rename-desktop-file: nheko.desktop -rename-appdata-file: nheko.appdata.xml finish-args: - --device=dri # needed for webcams, see #517 diff --git a/resources/nheko.appdata.xml b/resources/nheko.appdata.xml.in similarity index 93% rename from resources/nheko.appdata.xml rename to resources/nheko.appdata.xml.in index 5aafdc6d..ff572752 100644 --- a/resources/nheko.appdata.xml +++ b/resources/nheko.appdata.xml.in @@ -1,7 +1,8 @@ - nheko.desktop + @APPID@.desktop + @APPID@.desktop CC0-1.0 GPL-3.0-or-later nheko @@ -36,6 +37,10 @@ intense intense + + workstation + mobile + https://nheko-reborn.github.io/images/screenshots/chat.png diff --git a/resources/nheko.desktop b/resources/nheko.desktop index 4f454a74..90489a94 100644 --- a/resources/nheko.desktop +++ b/resources/nheko.desktop @@ -10,3 +10,5 @@ StartupWMClass=nheko Terminal=false MimeType=x-scheme-handler/matrix; X-GNOME-UsesNotifications=true +Keywords=Matrix;matrix.org;chat;irc;communications;talk;riot;element;fractal;voip; +X-KDE-Keywords=Matrix,matrix.org,chat,irc,communications,talk,riot,element,fractal,voip,