diff --git a/Tautulli.py b/Tautulli.py index c9bf92fb..c7faad29 100755 --- a/Tautulli.py +++ b/Tautulli.py @@ -243,7 +243,6 @@ def main(): # Try to start the server. Will exit here is address is already in use. webstart.start() - # Windows system tray icon if common.PLATFORM == 'Windows': if plexpy.CONFIG.SYS_TRAY_ICON: plexpy.WIN_SYS_TRAY_ICON = windows.WindowsSystemTray() @@ -260,6 +259,8 @@ def main(): plexpy.HTTP_ROOT) 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() @@ -268,7 +269,7 @@ def main(): def wait(): - # Wait endlessy for a signal to happen + # Wait endlessly for a signal to happen while True: if not plexpy.SIGNAL: try: @@ -294,6 +295,6 @@ def wait(): plexpy.SIGNAL = None -# Call main() + if __name__ == "__main__": main() diff --git a/plexpy/macos.py b/plexpy/macos.py index e1375bda..98a51903 100644 --- a/plexpy/macos.py +++ b/plexpy/macos.py @@ -43,7 +43,9 @@ class MacOSSystemTray(object): self.menu = [ rumps.MenuItem('Open Tautulli', callback=self.tray_open), + None, rumps.MenuItem('Start Tautulli at Login', callback=self.tray_startup), + None, rumps.MenuItem('Check for Updates', callback=self.tray_check_update), rumps.MenuItem('Restart', callback=self.tray_restart), rumps.MenuItem('Quit', callback=self.tray_quit) @@ -96,8 +98,7 @@ class MacOSSystemTray(object): self.update(icon=self.icon) def change_tray_startup_icon(self): - self.menu[1].state = plexpy.CONFIG.LAUNCH_STARTUP - self.tray_icon.menu = self.menu + self.tray_icon.menu['Start Tautulli at Login'].state = plexpy.CONFIG.LAUNCH_STARTUP def set_startup():