From 4bb5920c04e7dcd4a0fa8530b220b0232757bbfb Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 26 Apr 2020 19:37:01 -0700 Subject: [PATCH] Fix only MacOS system tray icon on Mac --- Tautulli.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Tautulli.py b/Tautulli.py index da519122..f2d9ff37 100755 --- a/Tautulli.py +++ b/Tautulli.py @@ -256,19 +256,22 @@ def main(): plexpy.launch_browser(plexpy.CONFIG.HTTP_HOST, plexpy.HTTP_PORT, plexpy.HTTP_ROOT) - try: - import AppKit - except ImportError: - logger.warn("The pyobjc module is missing. Install this " - "module to enable the system tray icon.") - plexpy.CONFIG.SYS_TRAY_ICON = False - if common.PLATFORM == 'Darwin' and plexpy.CONFIG.SYS_TRAY_ICON: - # MacOS system tray icon must be run on the main thread and is blocking - # Start the rest of Tautulli on a new thread - threading.Thread(target=wait).start() - plexpy.MAC_SYS_TRAY_ICON = macos.MacOSSystemTray() - plexpy.MAC_SYS_TRAY_ICON.start() + try: + import AppKit + except ImportError: + logger.warn("The pyobjc module is missing. Install this " + "module to enable the system tray icon.") + plexpy.CONFIG.SYS_TRAY_ICON = False + + if plexpy.CONFIG.SYS_TRAY_ICON: + # MacOS system tray icon must be run on the main thread and is blocking + # Start the rest of Tautulli on a new thread + threading.Thread(target=wait).start() + plexpy.MAC_SYS_TRAY_ICON = macos.MacOSSystemTray() + plexpy.MAC_SYS_TRAY_ICON.start() + else: + wait() else: wait()