mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
Make linux auto-run desktop file respect -appdata (#393)
--------- Co-authored-by: arm64v8a <48624112+arm64v8a@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
|
||||
#include "main/NekoRay.hpp"
|
||||
|
||||
// macOS headers (possibly OBJ-c)
|
||||
#if defined(Q_OS_MACOS)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
@@ -164,11 +166,20 @@ void AutoRun_SetEnabled(bool enable) {
|
||||
QString appName = QCoreApplication::applicationName();
|
||||
QString userAutoStartPath = getUserAutostartDir_private();
|
||||
QString desktopFileLocation = userAutoStartPath + appName + QLatin1String(".desktop");
|
||||
QStringList appCmdList = {QApplication::applicationFilePath(), "-tray"};
|
||||
QStringList appCmdList;
|
||||
|
||||
// nekoray: launcher
|
||||
if (qEnvironmentVariable("NKR_FROM_LAUNCHER") == "1") {
|
||||
appCmdList = QStringList{QApplication::applicationDirPath() + "/launcher", "--", "-tray"};
|
||||
appCmdList << QApplication::applicationDirPath() + "/launcher"
|
||||
<< "--";
|
||||
} else {
|
||||
appCmdList << QApplication::applicationFilePath();
|
||||
}
|
||||
|
||||
appCmdList << "-tray";
|
||||
|
||||
if (NekoRay::dataStore->flag_use_appdata) {
|
||||
appCmdList << "-appdata";
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
|
||||
Reference in New Issue
Block a user