Skip to content

Commit

Permalink
fix(packaing/linux): desktop file improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jan 19, 2025
1 parent 26566cc commit 8215421
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 28 deletions.
9 changes: 1 addition & 8 deletions cmake/packaging/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,8 @@ else()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
RENAME "${PROJECT_FQDN}.desktop")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_kms.desktop"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
RENAME "${PROJECT_FQDN}_kms.desktop")
endif()
if(${SUNSHINE_BUILD_FLATPAK})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_terminal.desktop"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
RENAME "${PROJECT_FQDN}_terminal.desktop")
elseif(NOT ${SUNSHINE_BUILD_APPIMAGE})
if(NOT ${SUNSHINE_BUILD_APPIMAGE} AND NOT ${SUNSHINE_BUILD_FLATPAK})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_terminal.desktop"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
endif()
Expand Down
6 changes: 2 additions & 4 deletions cmake/prep/special_package_configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ if(APPLE)
endif()
elseif(UNIX)
# configure the .desktop file
set(SUNSHINE_DESKTOP_ICON "sunshine.svg")
set(SUNSHINE_DESKTOP_ICON "sunshine")
if(${SUNSHINE_BUILD_APPIMAGE})
configure_file(packaging/linux/AppImage/sunshine.desktop sunshine.desktop @ONLY)
elseif(${SUNSHINE_BUILD_FLATPAK})
set(SUNSHINE_DESKTOP_ICON "${PROJECT_FQDN}.svg")
set(SUNSHINE_DESKTOP_ICON "${PROJECT_FQDN}")
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)
configure_file(packaging/linux/flatpak/${PROJECT_FQDN}.metainfo.xml
${PROJECT_FQDN}.metainfo.xml @ONLY)
else()
Expand Down
26 changes: 16 additions & 10 deletions packaging/linux/flatpak/sunshine.desktop
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
[Desktop Entry]
Type=Application
Name=@PROJECT_NAME@
Exec=@PROJECT_FQDN@
Version=1.0
Actions=RunInTerminal;KMS;
Categories=AudioVideo;Network;RemoteAccess;
Comment=@PROJECT_DESCRIPTION@
Exec=flatpak run @PROJECT_FQDN@
Icon=@SUNSHINE_DESKTOP_ICON@
Keywords=gamestream;stream;moonlight;remote play;
Categories=AudioVideo;Network;RemoteAccess;
Actions=RunInTerminal;KMS;
Name=@PROJECT_NAME@
Type=Application
Version=1.0

[Desktop Action RunInTerminal]
Exec=flatpak run @PROJECT_FQDN@
Icon=@SUNSHINE_DESKTOP_ICON@
Name=Run in Terminal
Icon=application-x-executable
Exec=gio launch @CMAKE_INSTALL_FULL_DATAROOTDIR@/applications/@PROJECT_FQDN@_terminal.desktop
NoDisplay=true
Terminal=true
Type=Application

[Desktop Action KMS]
Exec=sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') flatpak run @PROJECT_FQDN@
Icon=@SUNSHINE_DESKTOP_ICON@
Name=Run in Terminal (KMS)
Icon=application-x-executable
Exec=gio launch @CMAKE_INSTALL_FULL_DATAROOTDIR@/applications/@PROJECT_FQDN@_kms.desktop
NoDisplay=true
Terminal=true
Type=Application
6 changes: 0 additions & 6 deletions packaging/linux/flatpak/sunshine_kms.desktop

This file was deleted.

0 comments on commit 8215421

Please sign in to comment.