44 questions
1
vote
0
answers
82
views
How to stop system tray Icons from grouping together
I have a couple different projects that I am using pystray for, and these icons are grouping together when moving them in the system tray.
I've found that this is the case for anything using the ...
1
vote
0
answers
126
views
Pystray doesn't work when I compile my code with PyInstaller
My Python code works fine normally, but after compiling it with PyInstaller, pystray doesn't work. I'm getting the following error:
Traceback (most recent call last):
File "pystray/_xorg.py&...
0
votes
1
answer
86
views
Open the running process in the background (systray) with the pinned Taskbar app using Python & Windows
I've been trying to implement some Windows native functionality using tkinter, pystray and threading and some extra needed libraries unsuccessfully.
I'm trying to achieve this functionality:
The ...
1
vote
0
answers
176
views
I want the right click menu of pystray to also apear on left-click
I have a very simple pystray icon with a menu.
(Basicaly the normal example code)
Its also working so far. An Icon apears and if I right click it the menu apears.
But so far I couldn't find a way to ...
1
vote
1
answer
317
views
Pystray icon inappropriate behavior with Tkinter window withdraw
Description:
So I am using customtkinter library instead of tkinter, the issue I am facing is that I want my tkinter app to be withdrawn when closed if the minimize window checkbox is checked in ...
2
votes
2
answers
1k
views
OSError: [WinError 6] The handle is invalid. [Python]
Hey i am trying to make a application working in windows. It's basically adjusting your monitor brightness. There is a function provides minimize application. So i have issue about minimize.
When ...
4
votes
5
answers
12k
views
RuntimeError: can't create new thread at interpreter shutdown. Python 3.12
I am making a mouse jiggler and I can't get acces to the tray icon once the loop in the script is launched. I have asked another question but no one has answered yet, so I kept digging deeper into the ...
0
votes
0
answers
125
views
exit tkinter gui python program when click pystray menu build with asyncio and fastapi
minimal code
import sys
import threading
from fastapi import FastAPI
from fastapi.responses import FileResponse
from tkinter import *
from fastapi.staticfiles import StaticFiles
from fastapi....
3
votes
1
answer
1k
views
Python pystray update_menu, use variable text for item
I want to change the text for an item variably. to do this, i tried to update the menu using update_menu(). unfortunately, this didn't work and i couldn't find anything more detailed in the pystray ...
6
votes
1
answer
1k
views
How to create a menu separator in pystray
I am trying to create a pystray menu separator, but I am having a hard time doing so. I have searched here on SO and in its documentation, which I find super confusing and unhelpful and I even tried ...
2
votes
0
answers
54
views
Task Scheduler conflict with pystray
I created a python script that whenever is run creates a tray at the bottom right on Windows 11.
some code
...
image = PIL.Image.open(r"D:\payDisplay\images\pound_icon.png")
icon = pystray....
0
votes
0
answers
120
views
using tkinter and pystray at the same time
from pystray import MenuItem as item
import pystray
from PIL import Image
import tkinter as tk
window = tk.Tk()
#아이콘 트레이 행동
def quit_window(icon, item):
icon.visible = False
icon.stop()
#...
2
votes
1
answer
82
views
How to bring back the instance of python tkinter app that is hidden in windows system tray
I have a tkinter app that hides itself in the system tray when closed (X) , and keeps running in the background, I can also bring back the app from hidden tray to the front if I want, and this code ...
3
votes
1
answer
825
views
PyStray stops working once the main loop is launched (detached mode)
I am working on a side project which entails a main process that spawns an HTTP server that keeps listening for events and handles them within an infinite loop.
This works as intended and I am now ...
0
votes
0
answers
187
views
Win32 in Python - LoadImage gets handle of icon but InsertMenuItem throws error
I'm trying to add an icon to every menu option in a systray library in Python, pystray. For that I'm using win32 functions, I can sucessfully load an icon with extension .ico using the LoadImage ...
0
votes
1
answer
353
views
How to create a recursive folder menu using pystray?
I am trying to create a navigable tree of folders and subfolders using pystray. I am having trouble creating a recursive menu with pystray.
I am getting an error
"TypeError: MenuItem.__init__() ...
2
votes
0
answers
192
views
Remove pystray icon from outside of pystray menu
I have tkinter app which I am trying to add pystary icon. I just implemented it successfully. But I want to call "show window" method from another class not only from the menu item of ...
-1
votes
1
answer
718
views
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", ...
5
votes
1
answer
2k
views
Dynamically change tray icon with pystray
I want the tray icon to change according to the value of p_out. Specifically depending on its value, I want it to get a different color.
Here's the code
import pystray
import ping3
while True:
...
-1
votes
1
answer
352
views
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 ...
0
votes
0
answers
173
views
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
...
9
votes
1
answer
3k
views
Getting left-click on tray icon (Python | Pystray)
I am working on creating a tkinter window when the pystray icon is pressed so I can make my own Menu in the tray. But I have no idea how to get if the tray icon is pressed. Any help is appreciated! ...
0
votes
0
answers
137
views
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, ...
6
votes
1
answer
2k
views
Change pystray tray notification title
I have an issue with finding a way to change the pystray tray notification title. It appears that it's taking a default value of "Python" from somewhere. See the image below:
In the ...
2
votes
1
answer
2k
views
Include Pystray Icon when using PyInstaller
I am using PyInstaller to create a single file exe for my python application. I am also using Pystray to create a tray icon with a menu on it.
When running the script directly it works, but when I use ...
2
votes
1
answer
645
views
tkinter Toplevel window won't open from system tray menu
I'm trying to open a Toplevel window with tkinter, from a system tray menu.
from cmath import phase
from tkinter import *
from tkinter import messagebox, messagebox
from tracemalloc import start
from ...
2
votes
2
answers
2k
views
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", ...
2
votes
2
answers
3k
views
How to properly use run_detached() and stop() in pystray?
I'm trying to use pystray without blocking the main thread. Based on the pystray docs we can use the function run_detached() to start without blocking.
I'm using pystray on windows so, apparently I ...
1
vote
1
answer
718
views
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):
...
0
votes
1
answer
2k
views
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 ...
1
vote
1
answer
1k
views
Start Python script GUI minimized / in Windows Tray | Tkinter
I´ve built a simple GUI app, and I´m playing with pystray.
Actually, my script starts as usual, the first thing you see is the GUI.
If you klick on exit, the GUI minimize, and the tray Icon spawns.
...
0
votes
1
answer
1k
views
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:
...
2
votes
1
answer
1k
views
pystray with other codes execution
I require a code, to launch tray icon and execute other parts of codes...
So for that I tried below:
from pystray import MenuItem as item
import pystray
from PIL import Image, ImageDraw
import time
...
1
vote
1
answer
1k
views
How to provide dropdown submenus inside one tray menu as below shown in image using pystray library in python?
Here is my sample code:
image = Image.open("E:\\production\\Windows utility tool\\images\\icon.ico")
menu = (item("Sign in", show_window), item("Change status", ...
1
vote
0
answers
172
views
PyInstaller bundle exe not working even after adding additional data
I have a basic python script, Its a speech recognition script to let me shutdown my pc through voice commands and some additional stuff to have a tray icon. I have provided all of the code entirely as ...
2
votes
1
answer
2k
views
Why can't I close when using pystray?
I've written a program using tkinter which when the main window is closed is supposed to be minimized to the system tray. But when I try to exit the program clicking "Close" in the tray that ...
0
votes
1
answer
159
views
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 ...
1
vote
0
answers
1k
views
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 ...
1
vote
0
answers
69
views
Problem loading important libraries when using py2exe
I am trying to make a small weather app. Everything going perfect with my codes, except when i used this code to have a systray icon:
from pystray import MenuItem as item
import pystray
def ...
4
votes
1
answer
212
views
pyautogui issue with Pystray
Having issue with pyautogui and pystray. Using python Version 3.6.4.
Simply importing both modules into the same script and calling any pyautogui function produces an error.
Is there a fix to this or ...
3
votes
1
answer
791
views
sys.exit in python gives a SystemExit error pystray
I am running a PYSTRAY icon which starts a console program. When I try stopping it with this code
def stop_rtd():
print("Stopping RTD")
sys.exit()
icon.stop()
The system throws ...
3
votes
2
answers
2k
views
failed to execute script myfile.py using pyinstaller
from tkinter import*
from tkinter import filedialog
import tkinter.ttk as ttk
import datetime
import os
import pystray
from pystray import MenuItem as item
import win32com.client
import PIL.Image as ...
1
vote
1
answer
2k
views
Pystray icon available when running as a service
Using:
Python (3.7.5)
Pyinstaller (3.5)
Pywin32 (223)
Pystray (Current)
I have a python program that uses Pystray to show an icon which allows me to make Tkinter window available. It took a while ...
5
votes
1
answer
13k
views
How to create menu and update icon in Pystray
I want to use pystray module in Python to create a system tray app on Windows.
Code
Until now I managed to write this:
import pystray
from PIL import Image
image = Image.open("image.gif")
...