diff --git a/virtscreen/__main__.py b/virtscreen/__main__.py index 9d71542..0117c66 100755 --- a/virtscreen/__main__.py +++ b/virtscreen/__main__.py @@ -79,7 +79,7 @@ def main() -> None: def check_env(msg: Callable[[str], None]) -> None: """Check enveironments before start""" - if os.environ['XDG_SESSION_TYPE'].lower() == 'wayland': + if os.environ.get('XDG_SESSION_TYPE', '').lower() == 'wayland': msg("Currently Wayland is not supported") sys.exit(1) if not HOME_PATH: diff --git a/virtscreen/qt_backend.py b/virtscreen/qt_backend.py index 1c7e465..a2896c8 100644 --- a/virtscreen/qt_backend.py +++ b/virtscreen/qt_backend.py @@ -85,7 +85,7 @@ class Backend(QObject): else: value["available"] = False # Default Display settings app for a Desktop Environment - desktop_environ = os.environ['XDG_CURRENT_DESKTOP'].lower() + desktop_environ = os.environ.get('XDG_CURRENT_DESKTOP', '').lower() for key, value in data['displaySettingApps'].items(): for de in value['XDG_CURRENT_DESKTOP']: if de in desktop_environ: