Allow building as a non-flatpak app

This commit is contained in:
kramo
2023-03-16 17:24:03 +01:00
parent bb159f6503
commit 516c020cbc
10 changed files with 65 additions and 13 deletions

View File

@@ -17,6 +17,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
import os
import subprocess
import sys
@@ -25,7 +26,11 @@ from gi.repository import Gio
def run_command(executable):
with subprocess.Popen(
["flatpak-spawn --host " + executable], shell=True, start_new_session=True
["flatpak-spawn --host " + executable]
if os.getenv("FLATPAK_ID") == "hu.kramo.Cartridges"
else [executable],
shell=True,
start_new_session=True,
):
if Gio.Settings.new("hu.kramo.Cartridges").get_boolean("exit-after-launch"):
sys.exit()