mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 02:40:20 +08:00
fix: fixed autostart when using AppImage
This commit is contained in:
parent
60af0ab8bb
commit
a57b1417f9
@ -1 +1 @@
|
|||||||
4663
|
4664
|
@ -155,8 +155,11 @@ namespace Qv2ray::components::autolaunch
|
|||||||
}
|
}
|
||||||
|
|
||||||
#elif defined Q_OS_LINUX
|
#elif defined Q_OS_LINUX
|
||||||
// From
|
//
|
||||||
// https://github.com/nextcloud/desktop/blob/master/src/common/utility_unix.cpp
|
// For AppImage packaging.
|
||||||
|
auto binPath = qEnvironmentVariableIsSet("APPIMAGE") ? qEnvironmentVariable("APPIMAGE") : QCoreApplication::applicationFilePath();
|
||||||
|
//
|
||||||
|
// From https://github.com/nextcloud/desktop/blob/master/src/common/utility_unix.cpp
|
||||||
QString appName = QApplication::applicationName();
|
QString appName = QApplication::applicationName();
|
||||||
QString userAutoStartPath = getUserAutostartDir_private();
|
QString userAutoStartPath = getUserAutostartDir_private();
|
||||||
QString desktopFileLocation = userAutoStartPath + appName + QLatin1String(".desktop");
|
QString desktopFileLocation = userAutoStartPath + appName + QLatin1String(".desktop");
|
||||||
@ -184,7 +187,7 @@ namespace Qv2ray::components::autolaunch
|
|||||||
ts << QLatin1String("[Desktop Entry]") << endl
|
ts << QLatin1String("[Desktop Entry]") << endl
|
||||||
<< QLatin1String("Name=") << QApplication::applicationName() << endl
|
<< QLatin1String("Name=") << QApplication::applicationName() << endl
|
||||||
<< QLatin1String("GenericName=") << QLatin1String("V2ray Frontend") << endl
|
<< QLatin1String("GenericName=") << QLatin1String("V2ray Frontend") << endl
|
||||||
<< QLatin1String("Exec=") << QCoreApplication::applicationFilePath() << endl
|
<< QLatin1String("Exec=") << binPath << endl
|
||||||
<< QLatin1String("Terminal=") << "false" << endl
|
<< QLatin1String("Terminal=") << "false" << endl
|
||||||
<< QLatin1String("Icon=") << "qv2ray" << endl // always use lowercase for icons
|
<< QLatin1String("Icon=") << "qv2ray" << endl // always use lowercase for icons
|
||||||
<< QLatin1String("Categories=") << "Network" << endl
|
<< QLatin1String("Categories=") << "Network" << endl
|
||||||
|
Loading…
Reference in New Issue
Block a user