Add MacOS system tray icon

This commit is contained in:
JonnyWong16
2020-04-25 17:55:45 -07:00
parent 3001ff8c53
commit d5373c3992
2 changed files with 80 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ import locale
import pytz
import signal
import time
import threading
import tzlocal
import plexpy
@@ -257,6 +258,14 @@ def main():
plexpy.launch_browser(plexpy.CONFIG.HTTP_HOST, plexpy.HTTP_PORT,
plexpy.HTTP_ROOT)
if common.PLATFORM == 'Darwin':
threading.Thread(target=wait).start()
macos.MacOSSystemTray().start()
else:
wait()
def wait():
# Wait endlessy for a signal to happen
while True:
if not plexpy.SIGNAL: