diff --git a/client.py b/client.py index 3b9201a..6428500 100755 --- a/client.py +++ b/client.py @@ -12,8 +12,9 @@ from shutil import rmtree from threading import Thread from time import sleep -import pystray from PIL import Image, ImageTk +from pystray import Icon, Menu +from pystray import MenuItem as Item from requests import post from websocket import WebSocket @@ -27,7 +28,7 @@ _offline_icon = Image.open("img/icons/offline.png") _standby_icon = Image.open("img/icons/offline.png") -class MunyalClient(pystray.Icon): +class MunyalClient(Icon): def __init__(self): super(MunyalClient, self).__init__("Munyal") self.icon = _standby_icon @@ -49,8 +50,9 @@ class MunyalClient(pystray.Icon): name="downloader", daemon=True) thread_uploader.start() - # thread_downloader.start() + thread_downloader.start() self.run(self.__run) + self.menu = Menu(Item("Exit", lambda *args: sys.exit(0))) def __run(self, icon): icon.visible = True