From 592ff48148f5241d428861e8715067aabbd88fc7 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Sat, 17 Feb 2024 07:20:13 +0100 Subject: [PATCH] Fix autostart in flatpak --- gui/src/linux/background.py | 2 +- gui/src/linux/main.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gui/src/linux/background.py b/gui/src/linux/background.py index b14bec1..768704b 100644 --- a/gui/src/linux/background.py +++ b/gui/src/linux/background.py @@ -30,7 +30,7 @@ def request_autostart(): 'handle_token': GLib.Variant('s', f'com/quexten/Goldwarden/{token}'), 'reason': GLib.Variant('s', ('Autostart Goldwarden in the background.')), 'autostart': GLib.Variant('b', True), - 'commandline': GLib.Variant('as', ['main.py', '--hidden']), + 'commandline': GLib.Variant('as', ['goldwarden_ui_main.py', '--hidden']), 'dbus-activatable': GLib.Variant('b', False), } diff --git a/gui/src/linux/main.py b/gui/src/linux/main.py index 15e90fd..2ee918b 100644 --- a/gui/src/linux/main.py +++ b/gui/src/linux/main.py @@ -47,7 +47,8 @@ def main(): if is_flatpak: # to autostart the appes try: - subprocess.Popen(["python3", f'{source_path}/background.py'], start_new_session=True) + print("Enabling autostart...") + subprocess.Popen(["python3", "-m", "src.linux.background"], cwd=root_path, start_new_session=True) except Exception as e: pass