autostart: Enable setting via cmake Exec= path
See https://github.com/NixOS/nixpkgs/issues/199596 .
This commit is contained in:
parent
e5ffffcaec
commit
f7e36115ab
|
@ -116,6 +116,12 @@ if (SYNCTHING_WIDGETS_LOG_JAVASCRIPT_CONSOLE)
|
|||
message(WARNING "JavaScript console of web view will be logged to stderr")
|
||||
endif ()
|
||||
|
||||
# configure autostart .desktop file exec path
|
||||
option(AUTOSTART_EXEC_PATH "Set the Exec= path for Linux' autostart/syncthingtray.desktop file - useful for Nix & Guix")
|
||||
if (AUTOSTART_EXEC_PATH)
|
||||
add_compile_definitions(AUTOSTART_EXEC_PATH="${AUTOSTART_EXEC_PATH}")
|
||||
endif()
|
||||
|
||||
# link also explicitly against the following Qt modules
|
||||
list(APPEND ADDITIONAL_QT_MODULES Network Concurrent)
|
||||
|
||||
|
|
|
@ -802,7 +802,11 @@ bool setAutostartEnabled(bool enabled)
|
|||
desktopFile.write("[Desktop Entry]\n"
|
||||
"Name=" APP_NAME "\n"
|
||||
"Exec=\"");
|
||||
#if defined(AUTOSTART_EXEC_PATH)
|
||||
desktopFile.write(qEnvironmentVariable("APPIMAGE", AUTOSTART_EXEC_PATH).toUtf8().data());
|
||||
#else
|
||||
desktopFile.write(qEnvironmentVariable("APPIMAGE", QCoreApplication::applicationFilePath()).toUtf8().data());
|
||||
#endif
|
||||
desktopFile.write("\" qt-widgets-gui --single-instance\nComment=" APP_DESCRIPTION "\n"
|
||||
"Icon=" PROJECT_NAME "\n"
|
||||
"Type=Application\n"
|
||||
|
|
Loading…
Reference in New Issue