--- a/deluge/ui/gtk3/preferences.py~	2023-04-19 04:59:32.000000000 +0200
+++ b/deluge/ui/gtk3/preferences.py	2023-04-19 15:11:01.426919644 +0200
@@ -30,8 +30,12 @@
 from .path_chooser import PathChooser
 
 try:
-    require_version('AppIndicator3', '0.1')
-    from gi.repository import AppIndicator3  # noqa: F401
+    try:
+        require_version('AyatanaAppIndicator3', '0.1')
+        from gi.repository import AyatanaAppIndicator3 as AppIndicator3
+    except (ValueError, ImportError):
+        require_version('AppIndicator3', '0.1')
+        from gi.repository import AppIndicator3  # noqa: F401
 except (ImportError, ValueError):
     appindicator = False
 else:
