Questions tagged [pystray]

The pystray library allows the creation of system tray icons

This library allows the creation of system tray icons. Supported platforms are Linux under Xorg, GNOME and Ubuntu, macOS and Windows.

Github repository, usage and full documentation.

40 questions
0
votes
0 answers

Issue with tkinter window on restoring from systray

I'm new in python/tkinter/pystray. Used following code sample for my test application, run it on Windows 10: # Import the required libraries from tkinter import * from pystray import MenuItem as item import pystray from PIL import Image, ImageTk #…
Andrey K
  • 23
  • 3
0
votes
0 answers

PIL Image doesnt see the local file in the same directory

import pystray from PIL import Image from importlib import reload import os import webbrowser # Image for the tray image = Image.open("image.png") # Triggers for right click def stop(icon, item): icon.stop() def ss(icon, item): import…
0
votes
1 answer

Pystray - How can I open the program with double click on the System Tray icon using Tkinter?

I need the program to be opened by double clicking on the tray icon. Like this: def show(icon, item): icon.stop() root.after(0, root.deiconify()) icon = pystray.Icon("name", image, "Title", menu)#, doubleclick=show()) icon.run()
Pan
  • 3
  • 3
0
votes
1 answer

How to use multiple arguments calling a function in Pystray?

I'm trying to pass extra arguments to a function that is called by an item in pystray menu. import pystray from pystray import MenuItem as item from PIL import Image, ImageTk def show_window(icon): icon.notify('Hello World!', 'Hi') def…
JonLord
  • 175
  • 9
0
votes
1 answer

With Python/pystray, how to maximize a window from the system tray icon by clicking it?

Following this post, I've implemented to minimize the window of a app to system tray. However, i don't figured out how to restore the window by clicking in the system's tray icon. Only opening the menu and choosing 'show' optin this is…
0
votes
1 answer

How to fix "ImportError : This platform not supported" when using "pystray" with Pyinstaller?

So after I compiled the program I wrote using pyinstaller in one-file mode, The program doesn't seem to function at all. When I try to execute it, I receive the following Exception in a Window: Traceback (most recent call last): File "main.py",…
Insertx2k_Dev
  • 13
  • 1
  • 5
0
votes
1 answer

Why does pystary menu raises so many errors?

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…
MajliTech
  • 3
  • 1
  • 2
0
votes
0 answers

Can/should I use asyncio instead of threading with Pystray?

I'm writing a Python program which periodically scrapes a website for a single number, which is then displayed in the system tray via Pystray. I can make it do what I want using threading but would it be better to use asyncio - and if so, how? From…
Jack Deeth
  • 3,062
  • 3
  • 24
  • 39
-1
votes
1 answer

Pyinstaller Not Adding Image

I've been trying to complete this simple program and turn it into an exe, but every time I run the exe I receive the following error: Traceback (most recent call last): File "webtest.py", line 7, in File "PIL\Image.py", line 3227, in…
-1
votes
1 answer

correct path for files with PIL after compiling with pyinstaller

I'm using auto-py-to-exe which is based on pyinstaller, trying to make an executable with --onefile, using pystray to make a tray app, but after compiling I get an error that the icon file cannot be found. See that in the code I tried to use os.path…
Collaxd
  • 171
  • 1
  • 11
1 2
3