File 0001-Make-darkdetect-optional.diff of Package flatcam

--- a/appMain.py.origin	2025-09-17 20:21:36.384655808 +0300
+++ b/appMain.py	2025-09-17 21:12:25.533091790 +0300
@@ -123,7 +123,10 @@
 import appTranslation as fcTranslate
 import builtins
 
-import darkdetect
+try:
+    import darkdetect
+except:
+    darkdetect = None
 
 fcTranslate.apply_language('strings')
 if '_' not in builtins.__dict__:
@@ -613,7 +616,7 @@
         # self.preferencesUiManager.show_preferences_gui()
 
         # Set global_theme based on appearance
-        if self.options["global_appearance"] == 'auto':
+        if darkdetect and self.options["global_appearance"] == 'auto':
             if darkdetect.isDark():
                 theme = 'dark'
             else:
--- a/appGUI/MainGUI.py.origin	2025-09-17 20:21:36.367657005 +0300
+++ b/appGUI/MainGUI.py	2025-09-17 21:13:19.164591384 +0300
@@ -40,8 +40,6 @@
 import builtins
 import traceback
 
-import darkdetect
-
 fcTranslate.apply_language('strings')
 if '_' not in builtins.__dict__:
     _ = gettext.gettext
openSUSE Build Service is sponsored by