I want to make tray icon with pystray
. Howerer, it doesnt seem to work.
I dont wonna make this question too long, so I gonna put error here. Code i'm using:
...
import sys
import pystray
from pystray import Icon as icon, Menu as menu, MenuItem as item
from PIL import Image, ImageDraw
state = False
def quit(icon,item):
sys.exit(1)
m=(item(
"Wyjdź",
quit))
icon = pystray.Icon('AutoThemeChanger',title='AutoThemeChanger działa w tle',menu=m)
width = 120
height = 120
color1 = 255
color2 = 255
# Generate an image
image = Image.open("tray.png")
icon.icon = image
icon.visible=True
...
Can someone help me please?