normcap icon indicating copy to clipboard operation
normcap copied to clipboard

Statusbar icon disappears after run, preventing me from entering the settings

Open Lolle2000la opened this issue 6 months ago • 4 comments

What happened?

When I run the either the regular Flatpak or the AppImage (both latest and 0.6.0 beta) I can capture the (english) text of a window successfully, but not any other language. Attempting to enter the settings will fail with the context menu only containing a single entry "exit". After a few seconds that entry disappears.

Image

Below the shell output from the regular run:

22:15:42 - WARNING - normcap.gui.dbus:102 - Failed to move window via org.kde.kwin.Scripting!
22:15:42 - WARNING - normcap.gui.dbus:102 - Failed to move window via org.kde.kwin.Scripting!
22:15:42 - WARNING - normcap.gui.dbus:102 - Failed to move window via org.kde.kwin.Scripting!
22:15:49 - WARNING - normcap.notification.handlers.notify_send:95 - notify-send returned with error: Wait timeout expired # this one is only there when run without debug

How did you install NormCap?

FlatPak (Linux)

Operating System + Version?

Fedora 42

[Linux only] Display Server (DS) + Desktop environment (DE)?

DS: Wayland, DE: KDE Plasma 6

Debug log output?*

22:18:10 - INFO    - normcap:52 - Start NormCap v0.6.0-beta2
22:18:10 - DEBUG   - normcap:118 - Set XCURSOR_SIZE=24
22:18:10 - DEBUG   - normcap:123 - Set QT_QPA_PLATFORM=wayland
22:18:10 - DEBUG   - normcap:130 - Append /tmp/.mount_NormCagGOGna/usr/bin to AppImage internal PATH
22:18:10 - DEBUG   - normcap.gui.tray:71 - System info:
{'normcap_version': '0.6.0-beta2', 'python_version': '3.10.16', 'cli_args': '/tmp/.mount_NormCagGOGna/usr/app/normcap/__main__.py -v debug', 'is_briefcase_package': True, 'is_flatpak_package': False, 'is_appimage_package': True, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.KDE: 3>, 'display_manager_is_wayland': True, 'pyside6_version': '6.9.0', 'qt_version': '6.9.0', 'qt_library_path': '/tmp/.mount_NormCagGOGna/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCagGOGna/usr/python/bin', 'locale': 'ja_JP', 'config_directory': PosixPath('/home/luca/.config/normcap'), 'resources_path': PosixPath('/tmp/.mount_NormCagGOGna/usr/app/normcap/resources'), 'tesseract_path': PosixPath('/tmp/.mount_NormCagGOGna/usr/bin/tesseract'), 'tessdata_path': PosixPath('/home/luca/.config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=5120, top=403, right=7039, bottom=1482, device_pixel_ratio=1.0, index=0, screenshot=<PySide6.QtGui.QImage(null) at 0x7fd67459d080>), Screen(left=0, top=87, right=2559, bottom=1526, device_pixel_ratio=1.0, index=1, screenshot=<PySide6.QtGui.QImage(null) at 0x7fd67459d140>), Screen(left=2560, top=0, right=5119, bottom=1439, device_pixel_ratio=1.0, index=2, screenshot=<PySide6.QtGui.QImage(null) at 0x7fd67459d200>)]}
22:18:10 - DEBUG   - normcap.gui.settings:222 - Skip update of unknown setting (version: False)
22:18:10 - DEBUG   - normcap.gui.settings:222 - Skip update of unknown setting (cli-mode: False)
22:18:10 - DEBUG   - normcap.gui.settings:222 - Skip update of unknown setting (background-mode: False)
22:18:10 - DEBUG   - normcap.gui.settings:222 - Skip update of unknown setting (screenshot-handler: None)
22:18:10 - DEBUG   - normcap.gui.settings:222 - Skip update of unknown setting (clipboard-handler: None)
22:18:10 - DEBUG   - normcap.gui.settings:222 - Skip update of unknown setting (notification-handler: None)
22:18:10 - DEBUG   - normcap.gui.tray:422 - Listen on local socket v0.6.0-beta2-normcap.
22:18:10 - DEBUG   - normcap.detection.ocr.tesseract:122 - Executing '/tmp/.mount_NormCagGOGna/usr/bin/tesseract --list-langs --tessdata-dir /home/luca/.config/normcap/tessdata'
22:18:10 - DEBUG   - normcap.detection.ocr.tesseract:135 - Tesseract command output: List of available languages in "/home/luca/.config/normcap/tessdata/" (1): ¬ eng ¬
22:18:13 - DEBUG   - normcap.screenshot.main:28 - Compatible capture handlers: ['SPECTACLE', 'DBUS_PORTAL']
22:18:13 - DEBUG   - normcap.screenshot.handlers.spectacle:27 - normcap.screenshot.handlers.spectacle dependencies are installed (/usr/bin/spectacle)
22:18:13 - DEBUG   - normcap.screenshot.main:35 - Available capture handlers: ['SPECTACLE', 'DBUS_PORTAL']
22:18:15 - DEBUG   - normcap.screenshot.post_processing:17 - Virtual geometry width: 7040
22:18:15 - DEBUG   - normcap.screenshot.post_processing:18 - Image width: 7040
22:18:15 - DEBUG   - normcap.screenshot.post_processing:19 - Resize ratio: 1.0
22:18:15 - INFO    - normcap.screenshot.main:74 - Screen captured using SPECTACLE
22:18:15 - DEBUG   - normcap.gui.utils:34 - Save debug image as /tmp/normcap/2025-05-23_20-18-15_raw_screen0.png
22:18:15 - DEBUG   - normcap.gui.utils:34 - Save debug image as /tmp/normcap/2025-05-23_20-18-15_raw_screen1.png
22:18:15 - DEBUG   - normcap.gui.utils:34 - Save debug image as /tmp/normcap/2025-05-23_20-18-15_raw_screen2.png
22:18:15 - DEBUG   - normcap.gui.window:51 - Create window for screen 0
22:18:15 - DEBUG   - normcap.gui.window:139 - Set window of screen 0 to fullscreen
22:18:15 - DEBUG   - normcap.gui.window:51 - Create window for screen 1
22:18:15 - DEBUG   - normcap.gui.window:139 - Set window of screen 1 to fullscreen
22:18:15 - DEBUG   - normcap.gui.window:51 - Create window for screen 2
22:18:15 - DEBUG   - normcap.gui.window:139 - Set window of screen 2 to fullscreen
22:18:15 - DEBUG   - normcap.gui.dbus:72 - Moving window 'NormCap [0]' to (left=5120, top=403, right=7039, bottom=1482) via org.kde.kwin.Scripting
22:18:15 - WARNING - normcap.gui.dbus:102 - Failed to move window via org.kde.kwin.Scripting!
22:18:15 - DEBUG   - normcap.gui.dbus:103 - Traceback (most recent call last):
  File "/tmp/.mount_NormCagGOGna/usr/app/normcap/gui/dbus.py", line 96, in move_window_via_kde_kwin_scripting
    raise RuntimeError(  # noqa: TRY301
RuntimeError: ('org.kde.kwin.Scripting.loadScript response: %s', (13,))
22:18:15 - DEBUG   - normcap.gui.dbus:72 - Moving window 'NormCap [1]' to (left=0, top=87, right=2559, bottom=1526) via org.kde.kwin.Scripting
22:18:15 - WARNING - normcap.gui.dbus:102 - Failed to move window via org.kde.kwin.Scripting!
22:18:15 - DEBUG   - normcap.gui.dbus:103 - Traceback (most recent call last):
  File "/tmp/.mount_NormCagGOGna/usr/app/normcap/gui/dbus.py", line 96, in move_window_via_kde_kwin_scripting
    raise RuntimeError(  # noqa: TRY301
RuntimeError: ('org.kde.kwin.Scripting.loadScript response: %s', (14,))
22:18:15 - DEBUG   - normcap.gui.dbus:72 - Moving window 'NormCap [2]' to (left=2560, top=0, right=5119, bottom=1439) via org.kde.kwin.Scripting
22:18:15 - WARNING - normcap.gui.dbus:102 - Failed to move window via org.kde.kwin.Scripting!
22:18:15 - DEBUG   - normcap.gui.dbus:103 - Traceback (most recent call last):
  File "/tmp/.mount_NormCagGOGna/usr/app/normcap/gui/dbus.py", line 96, in move_window_via_kde_kwin_scripting
    raise RuntimeError(  # noqa: TRY301
RuntimeError: ('org.kde.kwin.Scripting.loadScript response: %s', (15,))
22:18:16 - DEBUG   - normcap.gui.tray:384 - Hide 3 windows
22:18:16 - INFO    - normcap.gui.utils:15 - Crop image to region (1225, 444, 1225, 444)
22:18:16 - DEBUG   - normcap.gui.utils:34 - Save debug image as /tmp/normcap/2025-05-23_20-18-16_cropped.png
22:18:16 - WARNING - normcap.gui.tray:273 - Area of 1px is too small. Skip detection.
22:18:16 - INFO    - normcap.gui.tray:598 - Exit normcap
22:18:16 - DEBUG   - normcap.gui.tray:599 - Debug images saved in /tmp/normcap

Lolle2000la avatar May 23 '25 20:05 Lolle2000la

@Lolle2000la

  1. The settings are not accessible from the statusbar icon. You can reach them only via the cog wheel icon which should show up on your main screen after launching NormCap (together with the border):

  2. By default, the icon in the statusbar is supposed to disappear, as some seconds after the detection, NormCap will exit. If you want to keep NormCap running in the statusbar, you can enable the option "Keep in system Tray" in the settings (like shown in the screenshot above.)

Does this solve your issue?

PS: Thanks for testing the NormCap 0.6.0 beta version. It would be super nice if you could share further feedback, if you have any 🙂

dynobo avatar May 24 '25 09:05 dynobo

Thank you for your reply! I think I got myself confused and misunderstood the instructions. I was able to successfully open the settings and download additional languages.

I think I got a bit confused by the cog wheel not being on my primary monitor, so it ended up outside of my peripheral vision (it doesn't help that my wallpaper is quite purple 😅). Do you think there could be an option to have it on the primary display? I definitely could have figured it out from the starting instructions, but I have a bit of a visual impairment so I tend to overlook things I need to search quite often.

I will also give feedback towards the beta version.

Again, thank you for your help!

Lolle2000la avatar May 24 '25 10:05 Lolle2000la

Thanks for your response, @Lolle2000la, glad I could help! 🙂

The menu button was meant to appear on the primary screen, but I didn't implement that correctly: it's currently shown on the first screen, which may not be the primary one. I’ve opened a separate bug issue (#743) for this.

May I ask a follow-up? Besides the menu button, is the window positioning working for you? Can you select regions on all your screens?

I ask because your log shows you’re using 3 monitors with KDE on Wayland. In that setup, window positioning is notoriously tricky. The workaround that used to help no longer works on recent KDE versions (therefore the warnings), so I’m curious to understand where it still works, and where it doesn’t.

dynobo avatar May 24 '25 13:05 dynobo

Of course! I tested it right now and it seems to work as expected.

Window positioning is working correctly for all three of my monitors. From left to right there are two 1440p displays and one 1080p display. I have tested scanning some text on all of them and it worked correctly on both the current flatpak and the beta-appimage version.

Fedora 42 is currently at KDE 6.3.5, so at least the most recent version on Wayland should be working fine I think. I have attached a screenshot of all three screens showing that every screen has the border applied correctly. If you have further things for me to test, be sure to tell me. If not, then from my side you can also close this issue as completed.

Image

Lolle2000la avatar May 24 '25 22:05 Lolle2000la