mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-07 06:18:05 +03:00
Relocate startup location if running in AppImage
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
from Furious.Utility.Constants import *
|
||||
from Furious.Utility.AppSettings import *
|
||||
from Furious.Utility.SystemRuntime import isScriptMode
|
||||
from Furious.Utility.SystemRuntime import getAppImagePath, isScriptMode
|
||||
|
||||
from PySide6 import QtCore
|
||||
|
||||
@@ -59,7 +59,7 @@ class StartupOnBoot:
|
||||
)
|
||||
|
||||
try:
|
||||
os.mkdir(autostartDir)
|
||||
os.makedirs(autostartDir, exist_ok=True)
|
||||
except FileExistsError:
|
||||
pass
|
||||
except Exception:
|
||||
@@ -67,6 +67,13 @@ class StartupOnBoot:
|
||||
|
||||
return False
|
||||
|
||||
appImagePath = getAppImagePath()
|
||||
|
||||
if appImagePath:
|
||||
execPath = appImagePath
|
||||
else:
|
||||
execPath = sys.argv[0]
|
||||
|
||||
try:
|
||||
with open(
|
||||
os.path.join(autostartDir, f'{APPLICATION_NAME}.desktop'),
|
||||
@@ -75,7 +82,7 @@ class StartupOnBoot:
|
||||
) as file:
|
||||
file.write(
|
||||
f'[Desktop Entry]\n'
|
||||
f'Exec={sys.argv[0]}\n'
|
||||
f'Exec={execPath}\n'
|
||||
f'Version={APPLICATION_VERSION}\n'
|
||||
f'Type=Application\n'
|
||||
f'Categories=Development\n'
|
||||
|
||||
Reference in New Issue
Block a user