From ab3ff2d355985a61d6d3420a3982333b6010000f Mon Sep 17 00:00:00 2001 From: detiam <44510779+detiam@users.noreply.github.com> Date: Thu, 26 Oct 2023 02:14:28 +0800 Subject: [PATCH] Update linux sunshine.desktop (#1768) --- cmake/packaging/linux.cmake | 7 ++++++- cmake/prep/special_package_configuration.cmake | 2 ++ packaging/linux/AppImage/sunshine.desktop | 3 ++- packaging/linux/flatpak/sunshine.desktop | 15 +++++++++++++-- packaging/linux/flatpak/sunshine_kms.desktop | 7 ++----- packaging/linux/sunshine.desktop | 12 +++++++++--- packaging/linux/sunshine_terminal.desktop | 6 ++++++ 7 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 packaging/linux/sunshine_terminal.desktop diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index aee40cb7..842277b9 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -88,7 +88,12 @@ endif() # desktop file # todo - validate desktop files with `desktop-file-validate` -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") +if(NOT ${SUNSHINE_BUILD_APPIMAGE}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_terminal.desktop" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") +endif() if(${SUNSHINE_BUILD_FLATPAK}) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_kms.desktop" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") diff --git a/cmake/prep/special_package_configuration.cmake b/cmake/prep/special_package_configuration.cmake index cd285a65..3094c239 100644 --- a/cmake/prep/special_package_configuration.cmake +++ b/cmake/prep/special_package_configuration.cmake @@ -9,8 +9,10 @@ elseif (UNIX) elseif(${SUNSHINE_BUILD_FLATPAK}) configure_file(packaging/linux/flatpak/sunshine.desktop sunshine.desktop @ONLY) configure_file(packaging/linux/flatpak/sunshine_kms.desktop sunshine_kms.desktop @ONLY) + configure_file(packaging/linux/sunshine_terminal.desktop sunshine_terminal.desktop @ONLY) else() configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY) + configure_file(packaging/linux/sunshine_terminal.desktop sunshine_terminal.desktop @ONLY) endif() # configure metadata file diff --git a/packaging/linux/AppImage/sunshine.desktop b/packaging/linux/AppImage/sunshine.desktop index a345e5dc..911735c8 100644 --- a/packaging/linux/AppImage/sunshine.desktop +++ b/packaging/linux/AppImage/sunshine.desktop @@ -5,7 +5,8 @@ Exec=sunshine Version=1.0 Comment=@PROJECT_DESCRIPTION@ Icon=sunshine -Categories=Utility; +Keywords=gamestream;stream;moonlight;remote play; +Categories=AudioVideo;Network;RemoteAccess; Terminal=true X-AppImage-Name=sunshine X-AppImage-Version=@PROJECT_VERSION@ diff --git a/packaging/linux/flatpak/sunshine.desktop b/packaging/linux/flatpak/sunshine.desktop index acfced8d..33124ab8 100644 --- a/packaging/linux/flatpak/sunshine.desktop +++ b/packaging/linux/flatpak/sunshine.desktop @@ -5,5 +5,16 @@ Exec=flatpak run dev.lizardbyte.sunshine Version=1.0 Comment=@PROJECT_DESCRIPTION@ Icon=sunshine -Categories=Utility; -Terminal=true +Keywords=gamestream;stream;moonlight;remote play; +Categories=AudioVideo;Network;RemoteAccess; +Actions=RunInTerminal;KMS; + +[Desktop Action RunInTerminal] +Name=Run in Terminal +Icon=application-x-executable +Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_terminal.desktop + +[Desktop Action KMS] +Name=Run in Terminal (KMS) +Icon=application-x-executable +Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_kms.desktop diff --git a/packaging/linux/flatpak/sunshine_kms.desktop b/packaging/linux/flatpak/sunshine_kms.desktop index 139fd0c4..521f4b93 100644 --- a/packaging/linux/flatpak/sunshine_kms.desktop +++ b/packaging/linux/flatpak/sunshine_kms.desktop @@ -1,9 +1,6 @@ [Desktop Entry] -Type=Application Name=@PROJECT_NAME@ (KMS) Exec=sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') flatpak run dev.lizardbyte.sunshine -Version=1.0 -Comment=@PROJECT_DESCRIPTION@ -Icon=sunshine -Categories=Utility; Terminal=true +Type=Application +NoDisplay=true diff --git a/packaging/linux/sunshine.desktop b/packaging/linux/sunshine.desktop index d5cf7c03..6bb8687f 100644 --- a/packaging/linux/sunshine.desktop +++ b/packaging/linux/sunshine.desktop @@ -1,9 +1,15 @@ [Desktop Entry] Type=Application Name=@PROJECT_NAME@ -Exec=sunshine +Exec=/usr/bin/env systemctl start --u sunshine Version=1.0 Comment=@PROJECT_DESCRIPTION@ Icon=sunshine -Categories=Utility; -Terminal=true +Keywords=gamestream;stream;moonlight;remote play; +Categories=AudioVideo;Network;RemoteAccess; +Actions=RunInTerminal; + +[Desktop Action RunInTerminal] +Name=Run in Terminal +Icon=application-x-executable +Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_terminal.desktop diff --git a/packaging/linux/sunshine_terminal.desktop b/packaging/linux/sunshine_terminal.desktop new file mode 100644 index 00000000..c2688912 --- /dev/null +++ b/packaging/linux/sunshine_terminal.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=@PROJECT_NAME@ +Exec=sunshine +Terminal=true +Type=Application +NoDisplay=true