From 4e63c385cbd8a1eb2db8ef0f5c8360cf6c8736c6 Mon Sep 17 00:00:00 2001 From: Roy <88516395+moraroy@users.noreply.github.com> Date: Sun, 4 Aug 2024 00:31:50 -0700 Subject: [PATCH] Update NSLGameScanner.py --- NSLGameScanner.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NSLGameScanner.py b/NSLGameScanner.py index 94523c3..34d30b0 100644 --- a/NSLGameScanner.py +++ b/NSLGameScanner.py @@ -15,6 +15,13 @@ from urllib.request import urlretrieve from base64 import b64encode import xml.etree.ElementTree as ET +# Check the value of the DBUS_SESSION_BUS_ADDRESS environment variable +dbus_address = os.environ.get('DBUS_SESSION_BUS_ADDRESS') +if not dbus_address or not dbus_address.startswith('unix:path='): + # Set the value of the DBUS_SESSION_BUS_ADDRESS environment variable + dbus_address = f'unix:path=/run/user/{os.getuid()}/bus' + os.environ['DBUS_SESSION_BUS_ADDRESS'] = dbus_address + # Path to the env_vars file env_vars_path = f"{os.environ['HOME']}/.config/systemd/user/env_vars"