From 5ddc7f8b0c7f13cd86500162dbdca51cd319e0d2 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Sun, 10 Nov 2024 19:47:08 -0500 Subject: [PATCH] refactor: mv res/dist/linux/app.desktop.in => deploy/org.deskflow.deskflow.desktop --- cmake/Packaging.cmake | 11 ----------- deploy/CMakeLists.txt | 6 ++++++ .../org.deskflow.deskflow.desktop | 7 +++---- src/gui/src/main.cpp | 2 +- 4 files changed, 10 insertions(+), 16 deletions(-) rename res/dist/linux/app.desktop.in => deploy/org.deskflow.deskflow.desktop (64%) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index ec44ead15..ce0a7d327 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -188,17 +188,6 @@ macro(configure_linux_packaging) # 12), so we must add it manually. set(CPACK_DEBIAN_PACKAGE_DEPENDS "qt6-qpa-plugins") - set(source_desktop_file ${DESKFLOW_PROJECT_RES_DIR}/dist/linux/app.desktop.in) - set(configured_desktop_file ${PROJECT_BINARY_DIR}/app.desktop) - set(install_desktop_file ${DESKFLOW_APP_ID}.desktop) - - configure_file(${source_desktop_file} ${configured_desktop_file} @ONLY) - - install( - FILES ${configured_desktop_file} - DESTINATION share/applications - RENAME ${install_desktop_file}) - # Prepare PKGBUILD for Arch Linux configure_file(${DESKFLOW_PROJECT_RES_DIR}/dist/arch/PKGBUILD.in ${CMAKE_BINARY_DIR}/PKGBUILD @ONLY) diff --git a/deploy/CMakeLists.txt b/deploy/CMakeLists.txt index f34e2d090..2155e434e 100644 --- a/deploy/CMakeLists.txt +++ b/deploy/CMakeLists.txt @@ -12,6 +12,12 @@ if(WIN32) elseif(NOT APPLE) + # Install our desktop file + install( + FILES ${CMAKE_CURRENT_LIST_DIR}/org.deskflow.deskflow.desktop + DESTINATION share/applications + ) + # Install our icon install( FILES ${CMAKE_CURRENT_LIST_DIR}/deskflow.png diff --git a/res/dist/linux/app.desktop.in b/deploy/org.deskflow.deskflow.desktop similarity index 64% rename from res/dist/linux/app.desktop.in rename to deploy/org.deskflow.deskflow.desktop index 15b9a7ecf..511345513 100644 --- a/res/dist/linux/app.desktop.in +++ b/deploy/org.deskflow.deskflow.desktop @@ -1,11 +1,10 @@ [Desktop Entry] Type=Application Version=1.0 -Name=@DESKFLOW_APP_NAME@ +Name=Deskflow Comment=Mouse and keyboard sharing utility -Path=/usr/bin -Exec=/usr/bin/@GUI_BINARY_NAME@ -Icon=@DESKFLOW_APP_ID@ +Exec=deskflow +Icon=org.deskflow.deskflow Terminal=false Categories=Utility; Keywords=keyboard;mouse;sharing;network;share; diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index a34711ad8..695fe8423 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationName(kAppName); QCoreApplication::setOrganizationName(kAppName); - QGuiApplication::setDesktopFileName(DESKFLOW_APP_ID); + QGuiApplication::setDesktopFileName(QStringLiteral("org.deskflow.deskflow")); // used as a prefix for settings paths, and must not be a url. QCoreApplication::setOrganizationDomain(kOrgDomain);