turing-smart-screen-python icon indicating copy to clipboard operation
turing-smart-screen-python copied to clipboard

Docking icon not working in Wayland

Open NuberuSH opened this issue 1 year ago • 4 comments

Describe the bug
Tray icon failed to dock

To Reproduce
Steps to reproduce the behavior:

  1. Run main.py
  2. See error

Expected behavior
Tray icon is visible in tray area

Environment:

  • Smart screen model: Turing 3.5”
  • Revision of this project:main branch
  • OS with version: Arch Linux with Sway (Wayland)
  • Python version: Python 3.12
  • Hardware: AMD Ryzen 7 7700X

Additional context
Besides this, everything is working fine. When testing with i3wm (X11) in the same system the try icon is shown. The error logs show it is trying to call for _xorg.py

Error log in Sway: 09/10/2024 05:11:22 PM [ERROR] Failed to dock icon Traceback (most recent call last): File "/home/user/ironwork/turing-smart-screen-python/.venv/lib/python3.12/site-packages/pystray/_xorg.py", line 162, in _update_icon self._assert_docked() File "/home/user/ironwork/turing-smart-screen-python/.venv/lib/python3.12/site-packages/pystray/_xorg.py", line 395, in _assert_docked assert self._systray_manager ^^^^^^^^^^^^^^^^^^^^^ AssertionError

NuberuSH avatar Sep 10 '24 15:09 NuberuSH

I have a kinda similar situation on Kubuntu 24.10 - in my case an icon does show up in the system tray, but:

  1. It it a solid green color - the white "graph" graphic is missing/not visible
  2. The right click menu does not show up when right clicking the icon.

There is no error in the console when running the application.

  • Smart screen model: Turing 3.5”
  • Revision of this project:main branch
  • OS with version: Kutuntu - KDE (Wayland)
  • Python version: Python 3.12

LE:

Terminal log

(turing-smart-screen-python) user@workstation:~/turing-smart-screen-python$ python main.py 
14.02.2025 12:18:36 [INFO] Loading theme 3.5inchTheme2 from res/themes/3.5inchTheme2/theme.yaml
14.02.2025 12:18:36 [DEBUG] HW revision: A
14.02.2025 12:18:36 [DEBUG] Auto detected COM port: /dev/ttyACM0
14.02.2025 12:18:36 [DEBUG] Using Python 3.12.7 (main, Jan 17 2025, 16:55:27) [GCC 14.2.0]
14.02.2025 12:18:36 [INFO] Tray icon has been displayed
14.02.2025 12:18:36 [INFO] Display reset (COM port may change)...
14.02.2025 12:18:41 [DEBUG] Static COM port: /dev/ttyACM0
14.02.2025 12:18:42 [DEBUG] HW sub-revision: SubRevision.TURING_3_5
14.02.2025 12:18:42 [DEBUG] Drawing Image: BACKGROUND
14.02.2025 12:18:42 [DEBUG] Bitmap /home/user/turing-smart-screen-python/res/themes/3.5inchTheme2/background.png is now loaded in the cache
14.02.2025 12:18:42 [DEBUG] Drawing Text: DISK_USED_LABEL
14.02.2025 12:18:42 [DEBUG] Drawing Text: DISK_FREE_LABEL
14.02.2025 12:18:42 [DEBUG] Drawing Text: DISK_TOTAL_LABEL
14.02.2025 12:18:42 [WARNING] No supported GPU found
14.02.2025 12:18:42 [WARNING] If you have an AMD GPU, you may need to install some  libraries manually: see https://github.com/mathoudebine/turing-smart-screen-python/wiki/Troubleshooting#linux--macos-no-supported-gpu-found-with-an-amd-gpu-and-python-311

Output stops here, the stats are correctly updated on the screen.

This is how the tray icon looks: Image

killermosi avatar Feb 14 '25 09:02 killermosi

I have a similar issue:

03/01/2025 04:37:22 PM [INFO] Loading theme 3.5inchTheme2 from res/themes/3.5inchTheme2/theme.yaml
03/01/2025 04:37:22 PM [WARNING] Cannot find valid DISPLAY_SIZE property in selected theme 3.5inchTheme2, defaulting to 3.5"
03/01/2025 04:37:22 PM [DEBUG] HW revision: A
03/01/2025 04:37:22 PM [DEBUG] Auto detected COM port: /dev/ttyACM0
03/01/2025 04:37:22 PM [DEBUG] Using Python 3.12.9 | packaged by Anaconda, Inc. | (main, Feb  6 2025, 18:56:27) [GCC 11.2.0]
03/01/2025 04:37:22 PM [INFO] Tray icon has been displayed
03/01/2025 04:37:22 PM [INFO] Initialize display
03/01/2025 04:37:22 PM [INFO] Display reset (COM port may change)...
03/01/2025 04:37:22 PM [ERROR] Failed to dock icon
Traceback (most recent call last):
  File "/home/arun/miniconda3/lib/python3.12/site-packages/pystray/_xorg.py", line 162, in _update_icon
    self._assert_docked()
  File "/home/arun/miniconda3/lib/python3.12/site-packages/pystray/_xorg.py", line 395, in _assert_docked
    assert self._systray_manager
           ^^^^^^^^^^^^^^^^^^^^^
AssertionError
03/01/2025 04:37:22 PM [ERROR] Failed to dock icon
Traceback (most recent call last):
  File "/home/arun/miniconda3/lib/python3.12/site-packages/pystray/_xorg.py", line 143, in _show
    self._assert_docked()
  File "/home/arun/miniconda3/lib/python3.12/site-packages/pystray/_xorg.py", line 395, in _assert_docked
    assert self._systray_manager
           ^^^^^^^^^^^^^^^^^^^^^
AssertionError

arunhk3 avatar Mar 01 '25 11:03 arunhk3

same here:

cd ~/Screen/turing-smart-screen-python source .venv/bin/activate python3 main.py

10.11.2025 10:32:40 [INFO] Loading theme SimpleGreenGauge from res/themes/SimpleGreenGauge/theme.yaml 10.11.2025 10:32:40 [DEBUG] HW revision: A 10.11.2025 10:32:40 [DEBUG] Auto detected COM port: /dev/ttyACM0 10.11.2025 10:32:40 [DEBUG] Using Python 3.13.7 (main, Aug 15 2025, 12:34:02) [GCC 15.2.1 20250813] 10.11.2025 10:32:40 [INFO] Tray icon has been displayed 10.11.2025 10:32:40 [INFO] Initialize display 10.11.2025 10:32:40 [INFO] Display reset (COM port may change)... 10.11.2025 10:32:40 [ERROR] Failed to dock icon Traceback (most recent call last): File "/home/user/Screen/turing-smart-screen-python/.venv/lib/python3.13/site-packages/pystray/_xorg.py", line 162, in _update_icon self._assert_docked() ~~~~~~~~~~~~~~~~~~~^^ File "/home/user/Screen/turing-smart-screen-python/.venv/lib/python3.13/site-packages/pystray/_xorg.py", line 395, in _assert_docked assert self._systray_manager ^^^^^^^^^^^^^^^^^^^^^ AssertionError 10.11.2025 10:32:40 [ERROR] Failed to dock icon Traceback (most recent call last): File "/home/user/Screen/turing-smart-screen-python/.venv/lib/python3.13/site-packages/pystray/_xorg.py", line 143, in _show self._assert_docked() ~~~~~~~~~~~~~~~~~~~^^ File "/home/user/Screen/turing-smart-screen-python/.venv/lib/python3.13/site-packages/pystray/_xorg.py", line 395, in _assert_docked assert self._systray_manager ^^^^^^^^^^^^^^^^^^^^^ AssertionError 10.11.2025 10:32:45 [DEBUG] Static COM port: /dev/ttyACM0 10.11.2025 10:32:46 [DEBUG] HW sub-revision: SubRevision.TURING_3_5 10.11.2025 10:32:46 [DEBUG] Drawing Image: BACKGROUND 10.11.2025 10:32:46 [DEBUG] Bitmap /home/user/Screen/turing-smart-screen-python/res/themes/SimpleGreenGauge/background.png is now loaded in the cache 10.11.2025 10:32:46 [DEBUG] Drawing Text: CPU_TEXT 10.11.2025 10:32:46 [DEBUG] Drawing Text: GPU_TEXT 10.11.2025 10:32:46 [DEBUG] Drawing Text: RAM_TEXT 10.11.2025 10:32:46 [DEBUG] Drawing Text: RAM_USED 10.11.2025 10:32:46 [DEBUG] Drawing Text: RAM_FREE 10.11.2025 10:32:46 [DEBUG] Drawing Text: DISK_TEXT 10.11.2025 10:32:46 [INFO] Waiting for all pending request to be sent to display (10s max)... 10.11.2025 10:32:48 [DEBUG] (Waited 1.9s) 10.11.2025 10:32:48 [INFO] Starting system monitoring 10.11.2025 10:32:49 [WARNING] No supported GPU found 10.11.2025 10:32:49 [WARNING] If you have an AMD GPU, you may need to install some libraries manually: see https://github.com/mathoudebine/turing-smart-screen-python/wiki/Troubleshooting#linux--macos-no-supported-gpu-found-with-an-amd-gpu-and-python-311 ^C10.11.2025 10:38:43 [INFO] Caught signal 2, exiting 10.11.2025 10:38:43 [INFO] Waiting for all pending request to be sent to display (5s max)... 10.11.2025 10:38:43 [DEBUG] (Waited 0.1s)

  • running on wayland / hyperland if this is relevant

ghost avatar Nov 10 '25 09:11 ghost

Same thing here. With recent updates, it no longer shows even a green box.

Turing version: 3.9.6 Screen: Turing 3.5” OS: Linux opensuse tumbleweed 20251205 Python version: 3.13.9 Display server: X11

Log: somebody@device:~/Downloads/turing-smart-screen-python-3.9.6> uv run main.py 13.12.2025 20.29.11 [INFO] Loading theme Terminal from res/themes/Terminal/theme.yaml 13.12.2025 20.29.11 [WARNING] Cannot find valid DISPLAY_SIZE property in selected theme Terminal, defaulting to 3.5" 13.12.2025 20.29.11 [DEBUG] HW revision: A 13.12.2025 20.29.11 [DEBUG] Auto detected COM port: /dev/ttyACM0 13.12.2025 20.29.11 [DEBUG] Using Python 3.13.9 (main, Nov 23 2025, 01:32:31) [GCC] 13.12.2025 20.29.11 [INFO] Tray icon has been displayed 13.12.2025 20.29.11 [INFO] Initialize display 13.12.2025 20.29.11 [INFO] Display reset (COM port may change)... 13.12.2025 20.29.16 [DEBUG] Static COM port: /dev/ttyACM0 13.12.2025 20.29.16 [DEBUG] HW sub-revision: SubRevision.USBMONITOR_3_5 13.12.2025 20.29.16 [DEBUG] Drawing Image: BACKGROUND 13.12.2025 20.29.16 [DEBUG] Bitmap /home/somebody/Downloads/turing-smart-screen-python-3.9.6/res/themes/Terminal/background.png is now loaded in the cache 13.12.2025 20.29.16 [DEBUG] Drawing Text: TEXT_EXAMPLE 13.12.2025 20.29.16 [INFO] Waiting for all pending request to be sent to display (10s max)... 13.12.2025 20.29.17 [DEBUG] (Waited 1.4s) 13.12.2025 20.29.17 [INFO] Starting system monitoring 13.12.2025 20.29.19 [INFO] Detected Nvidia GPU(s)

Sauce: Image

Jeonghu avatar Dec 13 '25 18:12 Jeonghu