diff --git a/ui/opensnitch/desktop_parser.py b/ui/opensnitch/desktop_parser.py index 67b9cced95..daf33320d2 100644 --- a/ui/opensnitch/desktop_parser.py +++ b/ui/opensnitch/desktop_parser.py @@ -1,12 +1,18 @@ from threading import Lock import configparser -import pyinotify import threading import glob import os import re import locale +is_pyinotify_available = True +try: + import pyinotify +except Exception as e: + is_pyinotify_available = False + print("Error importing pyinotify:", e) + DESKTOP_PATHS = tuple([ os.path.join(d, 'applications') for d in os.getenv('XDG_DATA_DIRS', '/usr/share/').split(':') @@ -36,7 +42,8 @@ def __init__(self): for desktop_file in glob.glob(os.path.join(desktop_path, '*.desktop')): self._parse_desktop_file(desktop_file) - self.start() + if is_pyinotify_available: + self.start() def get_locale(self): try: