Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux, hyperland] normcap.screengrab.ScreenshotRequestError: No object path received from xdg-portal! #375

Open
FieldofClay opened this issue Feb 1, 2023 · 20 comments
Assignees
Labels
bug Something isn't working

Comments

@FieldofClay
Copy link

AUR version of nromcap running under wayland with Hyprland WM. xdg-desktop-portal is installed, however it using the hyprland version (xdg-desktop-portal-hyprland-git), I'm not sure if that is part of the problem here.

System:

{  'cli_args': '/usr/bin/normcap -l eng -m parse -n True -t False -u False',
   'config_directory': PosixPath('/home/REDACTED/.config/normcap'),
   'desktop_environment': <DesktopEnvironment.OTHER: 0>,
   'display_manager_is_wayland': True,
   'envs': {'LD_LIBRARY_PATH': None, 'TESSDATA_PREFIX': None},
   'is_briefcase_package': False,
   'is_flatpak_package': False,
   'normcap_version': '0.4.0',
   'platform': 'linux',
   'pyside6_version': '6.4.2',
   'qt_library_path': '/usr/lib/qt6/plugins, /usr/bin',
   'qt_version': '6.4.2',
   'ressources_path': PosixPath('/usr/lib/python3.10/site-packages/normcap/resources'),
   'screens': [  Screen(is_primary=True,
                        device_pixel_ratio=2.0,
                        rect=Rect(left=0, top=0, right=2194, bottom=1234),
                        index=0,
                        screenshot=None),
                 Screen(is_primary=False,
                        device_pixel_ratio=1.0,
                        rect=Rect(left=2194, top=0, right=4114, bottom=1080),
                        index=1,
                        screenshot=None),
                 Screen(is_primary=False,
                        device_pixel_ratio=1.0,
                        rect=Rect(left=4114, top=0, right=6034, bottom=1080),
                        index=2,
                        screenshot=None)],
   'tessdata_path': None,
   'tesseract_path': PosixPath('/usr/bin/tesseract')}

Variables:

                  '__builtins__': <module 'builtins' (built-in)>,
                  '__cached__': None,
                  '__doc__': None,
                  '__file__': '/usr/bin/normcap',
                  '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7f1b11125060>,
                  '__name__': '__main__',
                  '__package__': None,
                  '__spec__': None,
                  'main': <function main at 0x7f1af4709b40>,
                  're': <module 're' from '/usr/lib/python3.10/re.py'>,
                  'sys': <module 'sys' (built-in)>},
   '__init__': {  '__class__': <class 'normcap.gui.tray.SystemTray'>,
                  'args': {...},
                  'parent': <PySide6.QtWidgets.QApplication(0x55d786bb23f0) at 0x7f1af44d1700>,
                  'self': 'REDACTED'},
   '_synchronized_capture': {  '_exception_triggered': <function _synchronized_capture.<locals>._exception_triggered at 0x7f1af470a440>,
                               '_signal_triggered': <function _synchronized_capture.<locals>._signal_triggered at 0x7f1af4709c60>,
                               'error': ScreenshotRequestError('No object path received from xdg-portal!'),
                               'exceptions': [...],
                               'interactive': False,
                               'loop': <PySide6.QtCore.QEventLoop(0x55d786c08c90) at 0x7f1af46e7140>,
                               'portal': <normcap.screengrab.dbus_portal.OrgFreedesktopPortalScreenshot(0x55d786c08e50) at 0x7f1af46e7480>,
                               'result': []},
   '_update_screenshots': {  'capture': <function capture at 0x7f1af470a320>,
                             'delayed': False,
                             'self': 'REDACTED'},
   'capture': {'result': []},
   'main': {  'app': <PySide6.QtWidgets.QApplication(0x55d786bb23f0) at 0x7f1af44d1700>,
              'args': Namespace(color=None, language=['eng'], mode='parse', notification=True, tray=True, update=True, reset=False, verbosity='warning', version=False)}}

Exception:

  normcap.screengrab.ScreenshotRequestError: No object path received from xdg-portal!

Traceback:

  File "/usr/bin/normcap", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/normcap/app.py", line 56, in main
    tray = SystemTray(app, vars(args))
  File "/usr/lib/python3.10/site-packages/normcap/gui/tray.py", line 96, in __init__
    self._update_screenshots(delayed=False)
  File "/usr/lib/python3.10/site-packages/normcap/gui/tray.py", line 201, in _update_screenshots
    screens = capture()
  File "/usr/lib/python3.10/site-packages/normcap/screengrab/dbus_portal.py", line 195, in capture
    result = _synchronized_capture(interactive=False)
  File "/usr/lib/python3.10/site-packages/normcap/screengrab/dbus_portal.py", line 150, in _synchronized_capture
    raise error
@dynobo
Copy link
Owner

dynobo commented Feb 1, 2023

Thanks for reporting this issue, @FieldofClay . I looked into the implementation of xdg-desktop-portal-hyperland, but honestly I think I don't understand enough of C and Wayland to identify the differences to the official reference implementation.

If someone has an example of another program retrieving a screenshot through DBUS in hyperland, that might help. (Does e.g. flameshot work for you?)

Anyway, I also would be super happy about a PR here!

@dynobo dynobo changed the title normcap.screengrab.ScreenshotRequestError: No object path received from xdg-portal! [Linux, hyperland] normcap.screengrab.ScreenshotRequestError: No object path received from xdg-portal! Feb 1, 2023
@dynobo dynobo added bug Something isn't working help wanted Looking for contributors to work on this issue labels Feb 1, 2023
@FieldofClay
Copy link
Author

Flameshot doesn't work for me, initially it complains that it can't detect the desktop environment (looks like it is looking at XDG_CURRENT_DESKTOP and doesn't recognise Hyprland - changing to Sway fixes this), however once it finally loads it prints out a very uninformative "unable to capture screen".

For screenshots most people with Hyprland use grim to take it, and optionally use slurp for selecting a portion of the screen.

@techsavvyumer
Copy link

Facing the same issue
`normcap
14:49:33 - ERROR - normcap.screengrab.dbus_portal:82 - No object path received from xdg-portal!
14:49:33 - CRITICAL - normcap:161 - Uncaught exception! Quitting NormCap!

System:

{  'cli_args': '/usr/bin/normcap',
   'config_directory': PosixPath('/home/REDACTED/.config/normcap'),
   'desktop_environment': <DesktopEnvironment.OTHER: 0>,
   'display_manager_is_wayland': True,
   'envs': {'LD_LIBRARY_PATH': None, 'TESSDATA_PREFIX': None},
   'is_briefcase_package': False,
   'is_flatpak_package': False,
   'normcap_version': '0.4.4',
   'platform': 'linux',
   'pyside6_version': '6.5.2',
   'qt_library_path': '/usr/lib/qt6/plugins, /usr/bin',
   'qt_version': '6.5.2',
   'ressources_path': PosixPath('/usr/lib/python3.11/site-packages/normcap/resources'),
   'screens': [  Screen(is_primary=True,
                        device_pixel_ratio=1.0,
                        rect=Rect(left=0, top=0, right=1920, bottom=1080),
                        index=0,
                        screenshot=None)],
   'tessdata_path': None,
   'tesseract_path': PosixPath('/usr/bin/tesseract')}

Variables:

                  '__builtins__': <module 'builtins' (built-in)>,
                  '__cached__': None,
                  '__doc__': None,
                  '__file__': '/usr/bin/normcap',
                  '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7fc831ff2e90>,
                  '__name__': '__main__',
                  '__package__': None,
                  '__spec__': None,
                  'main': <function main at 0x7fc829a48d60>,
                  're': <module 're' from '/usr/lib/python3.11/re/__init__.py'>,
                  'sys': <module 'sys' (built-in)>},
   '__init__': {  '__class__': <class 'normcap.gui.tray.SystemTray'>,
                  'args': {...},
                  'parent': <PySide6.QtWidgets.QApplication(0x557759d602a0) at 0x7fc831b177c0>,
                  'self': 'REDACTED'},
   '_synchronized_capture': {  '_exception_triggered': <function _synchronized_capture.<locals>._exception_triggered at 0x7fc829a49580>,
                               '_signal_triggered': <function _synchronized_capture.<locals>._signal_triggered at 0x7fc829a494e0>,
                               'error': ScreenshotRequestError('No object path received from xdg-portal!'),
                               'exceptions': [...],
                               'interactive': False,
                               'loop': <PySide6.QtCore.QEventLoop(0x557759ec7e20) at 0x7fc829a5e100>,
                               'portal': <normcap.screengrab.dbus_portal.OrgFreedesktopPortalScreenshot(0x557759ec8070) at 0x7fc829a5cb80>,
                               'result': []},
   '_update_screenshots': {  'capture': <function capture at 0x7fc831bd37e0>,
                             'delayed': False,
                             'self': 'REDACTED'},
   'capture': {'result': []},
   'main': {  'app': <PySide6.QtWidgets.QApplication(0x557759d602a0) at 0x7fc831b177c0>,
              'args': Namespace(color=None, language=None, mode=None, notification=None, tray=None, update=None, reset=False, verbosity='warning', version=False, cli_mode=False, background_mode=False)}}

Exception:

  normcap.screengrab.ScreenshotRequestError: No object path received from xdg-portal!

Traceback:

  File "/usr/bin/normcap", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/normcap/app.py", line 57, in main
    tray = SystemTray(app, vars(args))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/normcap/gui/tray.py", line 100, in __init__
    self._update_screenshots(delayed=False)
  File "/usr/lib/python3.11/site-packages/normcap/gui/tray.py", line 425, in _update_screenshots
    screens = capture()
              ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/normcap/screengrab/dbus_portal.py", line 197, in capture
    result = _synchronized_capture(interactive=False)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/normcap/screengrab/dbus_portal.py", line 152, in _synchronized_capture
    raise error

14:49:33 - CRITICAL - normcap:192 - Please open an issue with the output above on https://github.com/dynobo/normcap/issues`

@CaptaiNiveau
Copy link

Same for me. How can I help to resolve this issue?

@vaxerski
Copy link

vaxerski commented Sep 26, 2023

hi, hyprland dev

xdph's 1.0 rewrite doesn't support the screenshot portal yet, that's probably the issue here.

Most people use stuff like grim to make screenshots on wlroots-based compositors, that's why the portal hasn't been impl'd yet

@dynobo dynobo added this to the 0.5.0 milestone Oct 1, 2023
@dynobo
Copy link
Owner

dynobo commented Oct 1, 2023

Thanks for those insights, @vaxerski!

I'll see if I can implement support for using grim in the upcoming 0.5.0 version.

@CaptaiNiveau
Copy link

I fucked around a lot and got it to work on Hyprland.

There's some files with the available capabilities/interfaces of each xdg-portal in /usr/share/xdg-desktop-portal/portals, I removed the screenshot interface from the hyprland portal and installed the wlr portal, which properly implements this portal.

The code needed some small additions to detect Hyprland (just like sway). I'd like to contribute this, should I open a PR with some additions to the readme to get this to work in Hyprland?

Currently it requires manually editing the hyprland.portal file, as mentioned. So ideally I'd also try and make the hyprland portal work, either by removing the screenshot interface or making the interface work properly (probably the same as the wlr portal). Do you want to wait on this first?

@dynobo
Copy link
Owner

dynobo commented Oct 2, 2023

I'd like to contribute this, should I open a PR with some additions to the readme to get this to work in Hyprland?
[...]
Do you want to wait on this first?

Yes I'd appreciate such a PR, and yes, I'd also prefer to wait until hyperland's portal supports the screenshot interface, because I wouldn't feel comfortable proposing NormCap users to change system files.
(I also feel like complementing hyprland's interface would be most beneficial, because other tools would be able to use it, too!)

@CaptaiNiveau
Copy link

I’ll look into it tomorrow. I don’t have much C++ experience, but since there’s already a working implementation in the wlr portal I’ll try to make it work. The wlr portal also just uses grim under the hood, IIRC.

@dynobo dynobo removed the help wanted Looking for contributors to work on this issue label Oct 8, 2023
@dynobo
Copy link
Owner

dynobo commented Oct 8, 2023

I was able to add grim support as a quick fix into the v0.5.0-beta1 which just got published.

Would be great if you could try it, and report back if it works! I wasn't able to get Hyprland running in a VM, so I could not test it at all 🙈

BTW: Do you know, if there is a distro which offers hyprland out of the box? (I tried installing it in a Arch-VM, but no success, due to problems with getting 3D acceleration running...)

(Still it would be great to have a working screenshot portal on hyprland, though 😉 )

@CaptaiNiveau
Copy link

Ah, you can't get Hyprland working properly in a VM without a lot of effort due to the acceleration (I think you'd need to pass through a GPU IIRC).

Not sure if there's a distro that offers Hyprland OOTB, maybe something like Endeavour does. The arch-install script had an option added as well. Generally normal arch isn't that hard to set up either, if you follow the guide. I'll try NixOS in the future, seems to be quite nice (but also might cause headaches in some situations).

I tried the new release and got this (on my desktop without the patches):

❯ ./NormCap-0.5.0-beta1-x86_64.AppImage
23:43:24 - ERROR   - normcap.screengrab.dbus_portal:104 - No object path received from xdg-portal!
23:43:24 - CRITICAL - normcap:138 - Uncaught exception!
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/.mount_NormCaDhAu1v/usr/python/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/tmp/.mount_NormCaDhAu1v/usr/python/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/tmp/.mount_NormCaDhAu1v/usr/python/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/__main__.py", line 6, in <module>
    run()
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/app.py", line 99, in run
    app, tray = _prepare()
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/app.py", line 92, in _prepare
    tray = SystemTray(app, vars(args))
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/gui/tray.py", line 118, in __init__
    if not self._ensure_screenshot_permission():
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/gui/tray.py", line 402, in _ensure_screenshot_permission
    if screengrab.has_screenshot_permission():
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/screengrab/permissions.py", line 231, in has_screenshot_permission
    return _dbus_portal_has_screenshot_permission()
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/screengrab/permissions.py", line 200, in _dbus_portal_has_screenshot_permission
    result = dbus_portal.capture()
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/screengrab/dbus_portal.py", line 223, in capture
    result = _synchronized_capture(interactive=False)
  File "/tmp/.mount_NormCaDhAu1v/usr/app/normcap/screengrab/dbus_portal.py", line 200, in _synchronized_capture
    raise error
normcap.screengrab.exceptions.ScreenshotRequestError: No object path received from xdg-portal!
23:43:24 - CRITICAL - normcap:141 - System info: {'normcap_version': '0.5.0-beta1', 'python_version': '3.10.13', 'cli_args': '-c', 'is_briefcase_package': True, 'is_flatpak_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.HYPRLAND: 5>, 'display_manager_is_wayland': True, 'pyside6_version': '6.5.3', 'qt_version': '6.5.3', 'qt_library_path': '/tmp/.mount_NormCaDhAu1v/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCaDhAu1v/usr/python/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/captain/.config/normcap'), 'resources_path': PosixPath('/tmp/.mount_NormCaDhAu1v/usr/app/normcap/resources'), 'tesseract_path': PosixPath('/tmp/.mount_NormCaDhAu1v/usr/bin/tesseract'), 'tessdata_path': PosixPath('/home/captain/.config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=0, top=0, right=3198, bottom=1798, device_pixel_ratio=2.0, index=0, screenshot=None)]}
23:43:24 - CRITICAL - normcap:142 - Unfortunately, NormCap has to be terminated due to an unknown problem.
Please help improve NormCap by reporting this error, including the output above, on
https://github.com/dynobo/normcap/issues/new
Thanks!

I had to deal with a few other stupid issues in the meantime (audio crackling thanks to my new CPU etc.), so I didn't get that far with the desktop portals.
The wlr portal is written in C and the Hyprland portal in C++, both of which I'm mostly unfamiliar with, so translating it properly takes some effort. xdg-desktop-portal-wlr definitely uses grim under the hood though, mostly delegating all the portal API calls to it and checking/handling the different exit codes. I'll try and see if I can brew something in the next few weeks. Maybe I should open an issue on that repo first and ask if this contribution would be welcome, but I think it'll be.

@dynobo
Copy link
Owner

dynobo commented Oct 8, 2023

@CaptaiNiveau , thanks for trying. Do you have grim installed?

From the current output, it seems like it tried DBus-Portal again, which it should only do, if it can't find a working grim (but I might have implemented that check incorrectly).

Could you please provide the debug output generated by the following command?:

./NormCap-0.5.0-beta1-x86_64.AppImage -v debug

@dynobo dynobo modified the milestones: 0.5.0b1, 0.5.0 Oct 8, 2023
@dynobo dynobo modified the milestones: 0.5.0, 0.5.0b2 Oct 25, 2023
@dynobo dynobo modified the milestones: 0.5.0b2, 0.5.0 Nov 5, 2023
@dynobo dynobo removed this from the 0.5.0 milestone Dec 14, 2023
@KAGEYAM4
Copy link

KAGEYAM4 commented Dec 14, 2023

[phoenix@ArchLinux Downloads]$ ./NormCap-0.5.2-x86_64.AppImage -v debug
15:14:59 - INFO    - normcap:49 - Start NormCap v0.5.2
15:14:59 - DEBUG   - normcap:100 - Append /tmp/.mount_NormCaF5EpIU/usr/bin to AppImage internal PATH
15:14:59 - DEBUG   - normcap.gui.tray:79 - System info:
{'normcap_version': '0.5.2', 'python_version': '3.10.13', 'cli_args': '/tmp/.mount_NormCaF5EpIU/usr/app/normcap/__main__.py -v debug', 'is_briefcase_package': True, 'is_flatpak_package': False, 'is_appimage_package': True, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.HYPRLAND: 5>, 'display_manager_is_wayland': True, 'pyside6_version': '6.6.1', 'qt_version': '6.6.1', 'qt_library_path': '/tmp/.mount_NormCaF5EpIU/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCaF5EpIU/usr/python/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/phoenix/.config/normcap'), 'resources_path': PosixPath('/tmp/.mount_NormCaF5EpIU/usr/app/normcap/resources'), 'tesseract_path': PosixPath('/tmp/.mount_NormCaF5EpIU/usr/bin/tesseract'), 'tessdata_path': PosixPath('/home/phoenix/.config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=1920, top=1080, right=3455, bottom=1943, device_pixel_ratio=2.0, index=0, screenshot=None)]}
15:14:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
15:14:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
15:14:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
15:14:59 - DEBUG   - normcap.gui.tray:389 - Listen on local socket v0.5.2-normcap.
15:14:59 - DEBUG   - normcap.screengrab.utils:111 - grim output: stdout=, stderr=supplied geometry did not intersect with any outputs

15:14:59 - DEBUG   - normcap.screengrab.utils:120 - Support for grim is not available.
15:14:59 - DEBUG   - normcap.screengrab.main:30 - Select capture method DBUS portal
15:14:59 - DEBUG   - normcap.screengrab.dbus_portal:94 - DBus request message: <PySide6.QtDBus.QDBusMessage(type=MethodReturn, service=":1.51", signature="o", contents=([ObjectPath: /org/freedesktop/portal/desktop/request/1_306/normcap_cbbhihie]) ) at 0x7fa342b59c00>
15:14:59 - DEBUG   - normcap.screengrab.dbus_portal:101 - Request accepted
15:14:59 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/tmp/.mount_NormCaF5EpIU/usr/bin/tesseract --list-langs --tessdata-dir /home/phoenix/.config/normcap/tessdata'
15:14:59 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/home/phoenix/.config/normcap/tessdata/" (1): ¬ eng ¬
15:15:00 - DEBUG   - normcap.screengrab.dbus_portal:121 - DBus signal message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.51", path="/org/freedesktop/portal/desktop/request/1_306/normcap_cbbhihie", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(0, [Argument: a{sv} {"uri" = [Variant(QString): "file:https:///tmp/hypr/xdph_screenshot.png"]}]) ) at 0x7fa343344f80>
15:15:00 - DEBUG   - normcap.screengrab.dbus_portal:139 - Parse response
15:15:00 - DEBUG   - normcap.screengrab.utils:25 - Virtual geometry width: 1536
15:15:00 - DEBUG   - normcap.screengrab.utils:26 - Image width: 1920
15:15:00 - DEBUG   - normcap.screengrab.utils:27 - Resize ratio: 1.25
15:15:00 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-14_09-45-00_raw_screen0.png
15:15:00 - DEBUG   - normcap.gui.window:148 - Create window for screen 0
15:15:00 - DEBUG   - normcap.gui.window:216 - Set window of screen 0 to fullscreen
15:15:00 - DEBUG   - normcap.gui.window:207 - Move window 0 to (left=1920, top=1080, right=3455, bottom=1943)
15:15:02 - DEBUG   - normcap.gui.tray:355 - Hide 1 window
15:15:02 - INFO    - normcap.gui.tray:254 - Crop image to region (567, 327, 1540, 828)
15:15:02 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-14_09-45-02_cropped.png
15:15:02 - DEBUG   - normcap.gui.tray:279 - Start OCR
15:15:02 - DEBUG   - normcap.ocr.enhance:84 - Scale image x2
15:15:02 - DEBUG   - normcap.ocr.enhance:57 - Pad image by 80px
15:15:02 - DEBUG   - normcap.ocr.recognize:35 - Run Tesseract on image of size (2108, 1164) with args:
TessArgs(tessdata_path=PosixPath('/home/phoenix/.config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>)
15:15:02 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/tmp/.mount_NormCaF5EpIU/usr/bin/tesseract /tmp/tmpgdhubknj/normcap_tesseract_input.png /tmp/tmpgdhubknj/normcap_tesseract_input.png -c tessedit_create_tsv=1 -l eng --oem 3 --psm 3 --tessdata-dir /home/phoenix/.config/normcap/tessdata -c tessedit_write_images=1 -c tessedit_dump_pageseg_images=1'
15:15:02 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: 
15:15:02 - DEBUG   - normcap.ocr.tesseract:67 - Skip moving file to temp dir, it does not exist: /tmp/tmpgdhubknj/normcap_tesseract_input.png.png_debug.pdf
15:15:02 - DEBUG   - normcap.ocr.recognize:44 - OCR result:
OcrResult(tess_args=TessArgs(tessdata_path=PosixPath('/home/phoenix/.config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>), words=[], image=<PySide6.QtGui.QImage(QSize(2108, 1164),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=8432,sizeInBytes=9814848) at 0x7fa342b39180>, magic_scores={}, parsed='')
15:15:02 - INFO    - normcap.ocr.magics.email_magic:60 - 0 emails found 
15:15:02 - DEBUG   - normcap.ocr.magics.email_magic:71 - 0/0 (0) chars in emails
15:15:02 - INFO    - normcap.ocr.magics.url_magic:57 - 0 URLs found 
15:15:02 - DEBUG   - normcap.ocr.magics.url_magic:65 - 0/1 (0.0) chars in urls
15:15:02 - DEBUG   - normcap.ocr.magic:82 - Magic scores:
{'SingleLineMagic': 1, 'MultiLineMagic': 0, 'ParagraphMagic': 200.0, 'EmailMagic': 0, 'UrlMagic': 0.0}
15:15:02 - DEBUG   - normcap.ocr.recognize:48 - Parsed text:

15:15:02 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-14_09-45-02_enhanced.png
15:15:02 - INFO    - normcap.gui.tray:297 - Text from OCR:

15:15:02 - DEBUG   - normcap.gui.tray:331 - Nothing there to be copied to clipboard!
15:15:02 - DEBUG   - normcap.gui.notification:132 - Send notification via notify-send
15:15:02 - DEBUG   - normcap:176 - [QT] qtwarningmsg - the cached device pixel ratio value was stale on window expose.  please file a qtbug which explains how to reproduce.
15:15:07 - INFO    - normcap.gui.tray:618 - Exit normcap
15:15:07 - DEBUG   - normcap.gui.tray:619 - Debug images saved in /tmp/normcap

Screen Capture for context ->

Kooha-2023-12-14-15-14-56.webm

@dynobo
Copy link
Owner

dynobo commented Dec 14, 2023

Thanks, @KAGEYAM4 ! Seems like NormCap is calling grim with the wrong arguments. I'll look into it!

@dynobo
Copy link
Owner

dynobo commented Dec 15, 2023

@KAGEYAM4, could you please run this test build, again with the -v debug argument, and report how it works for you?

Download: https://file.io/yI5y5IM3g7d0
SHA256: b2fdc061c33aa6f668467c85be69a05ba92505761f65c3f040c65e62175ce938

@KAGEYAM4
Copy link

KAGEYAM4 commented Dec 15, 2023

-v debug

this output is from my hyprland with the config i am using, also the same video can be used for context which i posted above.

[phoenix@ArchLinux Downloads]$ ./NormCap-0.0.1-x86_64.AppImage -v debug
00:11:59 - INFO    - normcap:49 - Start NormCap v0.5.2
00:11:59 - DEBUG   - normcap:100 - Append /tmp/.mount_NormCaDyVTzg/usr/bin to AppImage internal PATH
00:11:59 - DEBUG   - normcap.gui.tray:79 - System info:
{'normcap_version': '0.5.2', 'python_version': '3.10.13', 'cli_args': '/tmp/.mount_NormCaDyVTzg/usr/app/normcap/__main__.py -v debug', 'is_briefcase_package': True, 'is_flatpak_package': False, 'is_appimage_package': True, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.HYPRLAND: 5>, 'display_manager_is_wayland': True, 'pyside6_version': '6.6.1', 'qt_version': '6.6.1', 'qt_library_path': '/tmp/.mount_NormCaDyVTzg/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCaDyVTzg/usr/python/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/phoenix/.config/normcap'), 'resources_path': PosixPath('/tmp/.mount_NormCaDyVTzg/usr/app/normcap/resources'), 'tesseract_path': PosixPath('/tmp/.mount_NormCaDyVTzg/usr/bin/tesseract'), 'tessdata_path': PosixPath('/home/phoenix/.config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=1920, top=1080, right=3455, bottom=1943, device_pixel_ratio=2.0, index=0, screenshot=None)]}
00:11:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
00:11:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
00:11:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
00:11:59 - DEBUG   - normcap.gui.tray:389 - Listen on local socket v0.5.2-normcap.
00:12:00 - DEBUG   - normcap.screengrab.utils:110 - grim output: stdout=, stderr=
00:12:00 - DEBUG   - normcap.screengrab.utils:119 - Support for grim is available.
00:12:00 - DEBUG   - normcap.screengrab.main:25 - Select capture method grim
00:12:00 - DEBUG   - normcap.screengrab.utils:25 - Virtual geometry width: 1536
00:12:00 - DEBUG   - normcap.screengrab.utils:26 - Image width: 1920
00:12:00 - DEBUG   - normcap.screengrab.utils:27 - Resize ratio: 1.25
00:12:00 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-15_18-42-00_raw_screen0.png
00:12:00 - DEBUG   - normcap.gui.window:148 - Create window for screen 0
00:12:00 - DEBUG   - normcap.gui.window:216 - Set window of screen 0 to fullscreen
00:12:00 - DEBUG   - normcap:176 - [QT] qtwarningmsg - qsystemtrayicon::setvisible: no icon set
00:12:00 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/tmp/.mount_NormCaDyVTzg/usr/bin/tesseract --list-langs --tessdata-dir /home/phoenix/.config/normcap/tessdata'
00:12:01 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/home/phoenix/.config/normcap/tessdata/" (1): ¬ eng ¬
00:12:01 - DEBUG   - normcap.gui.window:207 - Move window 0 to (left=1920, top=1080, right=3455, bottom=1943)
00:12:03 - DEBUG   - normcap.gui.tray:355 - Hide 1 window
00:12:03 - INFO    - normcap.gui.tray:254 - Crop image to region (441, 317, 1580, 915)
00:12:03 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-15_18-42-03_cropped.png
00:12:03 - DEBUG   - normcap.gui.tray:279 - Start OCR
00:12:03 - DEBUG   - normcap.ocr.enhance:84 - Scale image x2
00:12:03 - DEBUG   - normcap.ocr.enhance:57 - Pad image by 80px
00:12:04 - DEBUG   - normcap.ocr.recognize:35 - Run Tesseract on image of size (2440, 1358) with args:
TessArgs(tessdata_path=PosixPath('/home/phoenix/.config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>)
00:12:04 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/tmp/.mount_NormCaDyVTzg/usr/bin/tesseract /tmp/tmpjppz6lqv/normcap_tesseract_input.png /tmp/tmpjppz6lqv/normcap_tesseract_input.png -c tessedit_create_tsv=1 -l eng --oem 3 --psm 3 --tessdata-dir /home/phoenix/.config/normcap/tessdata -c tessedit_write_images=1 -c tessedit_dump_pageseg_images=1'
00:12:04 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: 
00:12:04 - DEBUG   - normcap.ocr.tesseract:67 - Skip moving file to temp dir, it does not exist: /tmp/tmpjppz6lqv/normcap_tesseract_input.png.png_debug.pdf
00:12:04 - DEBUG   - normcap.ocr.recognize:44 - OCR result:
OcrResult(tess_args=TessArgs(tessdata_path=PosixPath('/home/phoenix/.config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>), words=[], image=<PySide6.QtGui.QImage(QSize(2440, 1358),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=9760,sizeInBytes=13254080) at 0x7f51a6152800>, magic_scores={}, parsed='')
00:12:04 - INFO    - normcap.ocr.magics.email_magic:60 - 0 emails found 
00:12:04 - DEBUG   - normcap.ocr.magics.email_magic:71 - 0/0 (0) chars in emails
00:12:04 - INFO    - normcap.ocr.magics.url_magic:57 - 0 URLs found 
00:12:04 - DEBUG   - normcap.ocr.magics.url_magic:65 - 0/1 (0.0) chars in urls
00:12:04 - DEBUG   - normcap.ocr.magic:82 - Magic scores:
{'SingleLineMagic': 1, 'MultiLineMagic': 0, 'ParagraphMagic': 200.0, 'EmailMagic': 0, 'UrlMagic': 0.0}
00:12:04 - DEBUG   - normcap.ocr.recognize:48 - Parsed text:

00:12:04 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-15_18-42-04_enhanced.png
00:12:04 - INFO    - normcap.gui.tray:297 - Text from OCR:

00:12:04 - DEBUG   - normcap.gui.tray:331 - Nothing there to be copied to clipboard!
00:12:04 - DEBUG   - normcap.gui.notification:132 - Send notification via notify-send
00:12:04 - DEBUG   - normcap:176 - [QT] qtwarningmsg - the cached device pixel ratio value was stale on window expose.  please file a qtbug which explains how to reproduce.
00:12:09 - INFO    - normcap.gui.tray:618 - Exit normcap
00:12:09 - DEBUG   - normcap.gui.tray:619 - Debug images saved in /tmp/normcap
[phoenix@ArchLinux Downloads]$ 

@KAGEYAM4
Copy link

i tried this in my 2nd user account which has default config and there the visual are different, i will post it in a second.

@KAGEYAM4
Copy link

ok, so here is the thing, if my scaling is 1.25, normcap window opens in fullscreen with black inside.
But if my scaling is 1.0, normcap works perfectly.

Here's the complete log along with video for context -> https://file.io/76JG3XerQwVa (the video might be corrupted because i had to kill the program, for me mpv plays it perfectly)

[phoenix@ArchLinux ~]$ normcap --version
NormCap 0.5.2
[phoenix@ArchLinux ~]$ normcap -v debug
00:42:48 - INFO    - normcap:49 - Start NormCap v0.5.2
00:42:48 - DEBUG   - normcap.gui.tray:79 - System info:
{'normcap_version': '0.5.2', 'python_version': '3.11.6', 'cli_args': '/usr/bin/normcap -v debug', 'is_briefcase_package': False, 'is_flatpak_package': False, 'is_appimage_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.HYPRLAND: 5>, 'display_manager_is_wayland': True, 'pyside6_version': '6.6.1', 'qt_version': '6.6.1', 'qt_library_path': '/usr/lib/qt6/plugins, /usr/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/phoenix/.config/normcap'), 'resources_path': PosixPath('/usr/lib/python3.11/site-packages/normcap/resources'), 'tesseract_path': PosixPath('/usr/bin/tesseract'), 'tessdata_path': None, 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=1920, top=1080, right=3455, bottom=1943, device_pixel_ratio=2.0, index=0, screenshot=None)]}
00:42:48 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
00:42:48 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
00:42:48 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
00:42:48 - DEBUG   - normcap.gui.tray:389 - Listen on local socket .
00:42:48 - DEBUG   - normcap.screengrab.utils:111 - grim output: stdout=, stderr=supplied geometry did not intersect with any outputs

00:42:48 - DEBUG   - normcap.screengrab.utils:120 - Support for grim is not available.
00:42:48 - DEBUG   - normcap.screengrab.main:30 - Select capture method DBUS portal
00:42:48 - DEBUG   - normcap.screengrab.dbus_portal:94 - DBus request message: <PySide6.QtDBus.QDBusMessage(type=MethodReturn, service=":1.138", signature="o", contents=([ObjectPath: /org/freedesktop/portal/desktop/request/1_179/normcap_cddcgfba]) ) at 0x7f03b4e7b580>
00:42:48 - DEBUG   - normcap.screengrab.dbus_portal:101 - Request accepted
00:42:48 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/usr/bin/tesseract --list-langs'
00:42:48 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/usr/share/tessdata/" (2): ¬ eng ¬ osd ¬
00:42:48 - DEBUG   - normcap.screengrab.dbus_portal:121 - DBus signal message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.138", path="/org/freedesktop/portal/desktop/request/1_179/normcap_cddcgfba", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(0, [Argument: a{sv} {"uri" = [Variant(QString): "file:https:///tmp/hypr/xdph_screenshot.png"]}]) ) at 0x7f03bcea4200>
00:42:48 - DEBUG   - normcap.screengrab.dbus_portal:139 - Parse response
00:42:48 - DEBUG   - normcap.screengrab.utils:25 - Virtual geometry width: 1536
00:42:48 - DEBUG   - normcap.screengrab.utils:26 - Image width: 1920
00:42:48 - DEBUG   - normcap.screengrab.utils:27 - Resize ratio: 1.25
00:42:48 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-15_19-12-48_raw_screen0.png
00:42:48 - DEBUG   - normcap.gui.window:148 - Create window for screen 0
00:42:48 - DEBUG   - normcap.gui.window:216 - Set window of screen 0 to fullscreen
00:42:48 - DEBUG   - normcap.gui.window:207 - Move window 0 to (left=1920, top=1080, right=3455, bottom=1943)
00:42:50 - DEBUG   - normcap.gui.tray:355 - Hide 1 window
00:42:50 - INFO    - normcap.gui.tray:254 - Crop image to region (551, 256, 1450, 741)
00:42:50 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-1
2-15_19-12-50_cropped.png
00:42:50 - DEBUG   - normcap.gui.tray:279 - Start OCR
00:42:50 - DEBUG   - normcap.ocr.enhance:84 - Scale image x2
00:42:50 - DEBUG   - normcap.ocr.enhance:57 - Pad image by 80px
00:42:50 - DEBUG   - normcap.ocr.recognize:35 - Run Tesseract on image of size (1960, 1132) with args:
TessArgs(tessdata_path=None, lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>)
00:42:50 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/usr/bin/tesseract /tmp/tmphmbcuaxb/normcap_tesseract_input.png /tmp/tmphmbcuaxb/normcap_tesseract_input.png -c tessedit_create_tsv=1 -l eng --oem 3 --psm 3 -c tessedit_write_images=1 -c tessedit_dump_pageseg_images=1'
00:42:51 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: 
00:42:51 - DEBUG   - normcap.ocr.tesseract:67 - Skip moving file to temp dir, it does not exist: /tmp/tmphmbcuaxb/normcap_tesseract_input.png.png_debug.pdf
00:42:51 - DEBUG   - normcap.ocr.recognize:44 - OCR result:
OcrResult(tess_args=TessArgs(tessdata_path=None, lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>), words=[], image=<PySide6.QtGui.QImage(QSize(1960, 1132),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=7840,sizeInBytes=8874880) at 0x7f03b4e79940>, magic_scores={}, parsed='')
00:42:51 - INFO    - normcap.ocr.magics.email_magic:60 - 0 emails found 
00:42:51 - DEBUG   - normcap.ocr.magics.email_magic:71 - 0/0 (0) chars in emails
00:42:51 - INFO    - normcap.ocr.magics.url_magic:57 - 0 URLs found 
00:42:51 - DEBUG   - normcap.ocr.magics.url_magic:65 - 0/1 (0.0) chars in urls
00:42:51 - DEBUG   - normcap.ocr.magic:82 - Magic scores:
{'SingleLineMagic': 1, 'MultiLineMagic': 0, 'ParagraphMagic': 200.0, 'EmailMagic': 0, 'UrlMagic': 0.0}
00:42:51 - DEBUG   - normcap.ocr.recognize:48 - Parsed text:

00:42:51 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-15_19-12-51_enhanced.png
00:42:51 - INFO    - normcap.gui.tray:297 - Text from OCR:

00:42:51 - DEBUG   - normcap.gui.tray:331 - Nothing there to be copied to clipboard!
00:42:51 - DEBUG   - normcap.gui.notification:132 - Send notification via notify-send
00:42:51 - DEBUG   - normcap:176 - [QT] qtwarningmsg - the cached device pixel ratio value was stale on window expose.  please file a qtbug which explains how to reproduce.
00:42:56 - INFO    - normcap.gui.tray:618 - Exit normcap
00:42:56 - DEBUG   - normcap.gui.tray:619 - Debug images saved in /tmp/normcap
[phoenix@ArchLinux ~]$ normcap -v debug
00:43:02 - INFO    - normcap:49 - Start NormCap v0.5.2
00:43:02 - DEBUG   - normcap.gui.tray:79 - System info:
{'normcap_version': '0.5.2', 'python_version': '3.11.6', 'cli_args': '/usr/bin/normcap -v debug', 'is_briefcase_package': False, 'is_flatpak_package': False, 'is_appimage_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.HYPRLAND: 5>, 'display_manager_is_wayland': True, 'pyside6_version': '6.6.1', 'qt_version': '6.6.1', 'qt_library_path': '/usr/lib/qt6/plugins, /usr/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/phoenix/.config/normcap'), 'resources_path': PosixPath('/usr/lib/python3.11/site-packages/normcap/resources'), 'tesseract_path': PosixPath('/usr/bin/tesseract'), 'tessdata_path': None, 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=0, top=0, right=1279, bottom=719, device_pixel_ratio=2.0, index=0, screenshot=None)]}
00:43:02 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
00:43:02 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
00:43:02 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
00:43:02 - DEBUG   - normcap.gui.tray:389 - Listen on local socket .
00:43:02 - DEBUG   - normcap.screengrab.utils:111 - grim output: stdout=, stderr=
00:43:02 - DEBUG   - normcap.screengrab.utils:120 - Support for grim is available.
00:43:02 - DEBUG   - normcap.screengrab.main:25 - Select capture method grim
00:43:03 - DEBUG   - normcap.screengrab.utils:25 - Virtual geometry width: 1280
00:43:03 - DEBUG   - normcap.screengrab.utils:26 - Image width: 1920
00:43:03 - DEBUG   - normcap.screengrab.utils:27 - Resize ratio: 1.5
00:43:03 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-15_19-13-03_raw_screen0.png
00:43:03 - DEBUG   - normcap.gui.window:148 - Create window for screen 0
00:43:03 - DEBUG   - normcap.gui.window:216 - Set window of screen 0 to fullscreen
00:43:03 - DEBUG   - normcap:176 - [QT] qtwarningmsg - qsystemtrayicon::setvisible: no icon set
00:43:03 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/usr/bin/tesseract --list-langs'
00:43:03 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/usr/share/tessdata/" (2): ¬ eng ¬ osd ¬
00:43:03 - DEBUG   - normcap.gui.window:207 - Move window 0 to (left=0, top=0, right=1279, bottom=719)
00:43:07 - DEBUG   - normcap.gui.tray:355 - Hide 1 window
00:43:07 - INFO    - normcap.gui.tray:254 - Crop image to region (105, 328, 856, 501)
00:43:07 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-15_19-13-07_cropped.png
00:43:07 - DEBUG   - normcap.gui.tray:279 - Start OCR
00:43:07 - DEBUG   - normcap.ocr.enhance:84 - Scale image x2
00:43:07 - DEBUG   - normcap.ocr.enhance:57 - Pad image by 80px
00:43:07 - DEBUG   - normcap.ocr.recognize:35 - Run Tesseract on image of size (1664, 508) with args:
TessArgs(tessdata_path=None, lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>)
00:43:07 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/usr/bin/tesseract /tmp/tmplekr_60_/normcap_tesseract_input.png /tmp/tmplekr_60_/normcap_tesseract_input.png -c tessedit_create_tsv=1 -l eng --oem 3 --psm 3 -c tessedit_write_images=1 -c tessedit_dump_pageseg_images=1'
00:43:07 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: 
00:43:07 - DEBUG   - normcap.ocr.tesseract:67 - Skip moving file to temp dir, it does not exist: /tmp/tmplekr_60_/normcap_tesseract_input.png.png_debug.pdf
00:43:07 - DEBUG   - normcap.ocr.recognize:44 - OCR result:
OcrResult(tess_args=TessArgs(tessdata_path=None, lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>), words=[{'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 1, 'left': 116, 'top': 108, 'width': 96, 'height': 36, 'conf': 90.169807, 'text': 'bind'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 2, 'left': 326, 'top': 136, 'width': 7, 'height': 16, 'conf': 84.781281, 'text': ','}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 3, 'left': 372, 'top': 111, 'width': 63, 'height': 41, 'conf': 89.055962, 'text': 'F9,'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 4, 'left': 472, 'top': 118, 'width': 116, 'height': 34, 'conf': 90.290649, 'text': 'exec,'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 5, 'left': 626, 'top': 110, 'width': 225, 'height': 44, 'conf': 88.400352, 'text': 'playerctl'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 6, 'left': 882, 'top': 111, 'width': 96, 'height': 32, 'conf': 92.22982, 'text': 'next'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 2, 'line_num': 1, 'word_num': 1, 'left': 116, 'top': 160, 'width': 96, 'height': 36, 'conf': 89.898941, 'text': 'bind'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 2, 'line_num': 1, 'word_num': 2, 'left': 326, 'top': 189, 'width': 7, 'height': 15, 'conf': 91.181976, 'text': ','}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 2, 'line_num': 1, 'word_num': 3, 'left': 372, 'top': 164, 'width': 63, 'height': 40, 'conf': 91.803299, 'text': 'F8,'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 2, 'line_num': 1, 'word_num': 4, 'left': 472, 'top': 171, 'width': 116, 'height': 33, 'conf': 91.777237, 'text': 'exec,'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 2, 'line_num': 1, 'word_num': 5, 'left': 626, 'top': 162, 'width': 225, 'height': 44, 'conf': 91.114014, 'text': 'playerctl'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 2, 'line_num': 1, 'word_num': 6, 'left': 882, 'top': 160, 'width': 198, 'height': 46, 'conf': 91.114014, 'text': 'previous'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 1, 'left': 116, 'top': 213, 'width': 96, 'height': 36, 'conf': 91.540375, 'text': 'bind'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 2, 'left': 242, 'top': 225, 'width': 23, 'height': 15, 'conf': 90.670868, 'text': '='}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 3, 'left': 300, 'top': 242, 'width': 8, 'height': 15, 'conf': 90.670868, 'text': ','}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 4, 'left': 346, 'top': 216, 'width': 89, 'height': 41, 'conf': 90.813316, 'text': 'F11,'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 5, 'left': 472, 'top': 224, 'width': 116, 'height': 33, 'conf': 92.323486, 'text': 'exec,'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 6, 'left': 626, 'top': 214, 'width': 124, 'height': 44, 'conf': 92.586548, 'text': 'sleep'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 7, 'left': 778, 'top': 216, 'width': 74, 'height': 32, 'conf': 92.082108, 'text': '0.5'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 8, 'left': 888, 'top': 224, 'width': 7, 'height': 33, 'conf': 92.082108, 'text': ';'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 9, 'left': 932, 'top': 214, 'width': 174, 'height': 44, 'conf': 91.616104, 'text': 'hyprctl'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 10, 'left': 1135, 'top': 213, 'width': 200, 'height': 45, 'conf': 91.944618, 'text': 'dispatch'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 11, 'left': 1365, 'top': 214, 'width': 97, 'height': 44, 'conf': 90.501526, 'text': 'dpms'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 1, 'word_num': 12, 'left': 1494, 'top': 214, 'width': 72, 'height': 34, 'conf': 90.501526, 'text': 'off'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 2, 'word_num': 1, 'left': 116, 'top': 266, 'width': 96, 'height': 35, 'conf': 91.126221, 'text': 'bind'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 2, 'word_num': 2, 'left': 326, 'top': 294, 'width': 7, 'height': 16, 'conf': 88.710342, 'text': ','}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 2, 'word_num': 3, 'left': 372, 'top': 268, 'width': 89, 'height': 42, 'conf': 90.687386, 'text': 'F12,'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 2, 'word_num': 4, 'left': 498, 'top': 276, 'width': 116, 'height': 34, 'conf': 90.145805, 'text': 'exec,'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 2, 'word_num': 5, 'left': 652, 'top': 276, 'width': 147, 'height': 24, 'conf': 91.496201, 'text': 'nomacs'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 3, 'line_num': 2, 'word_num': 6, 'left': 829, 'top': 266, 'width': 685, 'height': 45, 'conf': 87.091675, 'text': '~/src/miryoku-layout-images'}], image=<PySide6.QtGui.QImage(QSize(1664, 508),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=6656,sizeInBytes=3381248) at 0x7fa9659b1140>, magic_scores={}, parsed='')
00:43:07 - INFO    - normcap.ocr.magics.email_magic:60 - 0 emails found 
00:43:07 - DEBUG   - normcap.ocr.magics.email_magic:71 - 0/136 (0.0) chars in emails
00:43:07 - INFO    - normcap.ocr.magics.url_magic:57 - 0 URLs found 
00:43:07 - DEBUG   - normcap.ocr.magics.url_magic:65 - 0/178 (0.0) chars in urls
00:43:07 - DEBUG   - normcap.ocr.magic:82 - Magic scores:
{'SingleLineMagic': 0, 'MultiLineMagic': 0, 'ParagraphMagic': 66.66666666666666, 'EmailMagic': 0.0, 'UrlMagic': 0.0}
00:43:07 - DEBUG   - normcap.ocr.recognize:48 - Parsed text:
bind , F9, exec, playerctl next
bind , F8, exec, playerctl previous
bind = , F11, exec, sleep 0.5 ; hyprctl dispatch dpms off bind , F12
, exec, nomacs ~/src/miryoku-layout-images
00:43:07 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-15_19-13-07_enhanced.png
00:43:07 - INFO    - normcap.gui.tray:297 - Text from OCR:
bind , F9, exec, playerctl next
bind , F8, exec, playerctl previous
bind = , F11, exec, sleep 0.5 ; hyprctl dispatch dpms off bind , F12, exec, nomacs ~/src/miryoku-layout-images
00:43:07 - DEBUG   - normcap.gui.tray:333 - Copy text to clipboard
00:43:07 - DEBUG   - normcap.clipboard.handlers.windll:187 - WindllHandler is incompatible on non-Windows systems
00:43:07 - DEBUG   - normcap.clipboard.handlers.pbcopy:25 - PbCopyHandler is incompatible on non-macOS systems
00:43:07 - DEBUG   - normcap.clipboard.handlers.xclip:35 - XclipCopyHandler is not compatible: xclip was not found
00:43:07 - WARNING - normcap.clipboard.handlers.xclip:36 - Your Linux runs with Wayland. Please install the system package 'xclip' to ensure that text can be copied to the clipboard correctly
00:43:07 - DEBUG   - normcap.clipboard.handlers.wlclipboard:45 - WlCopyHandler is compatible (/usr/bin/wl-copy)
00:43:07 - DEBUG   - normcap.clipboard.handlers.qtclipboard:31 - QtCopyHandler is not compatible with Wayland
00:43:07 - DEBUG   - normcap.clipboard.main:53 - Text copied to clipboard using WlCopyHandler.
00:43:07 - DEBUG   - normcap.gui.notification:132 - Send notification via notify-send
00:43:07 - DEBUG   - normcap:176 - [QT] qtwarningmsg - the cached device pixel ratio value was stale on window expose.  please file a qtbug which explains how to reproduce.
00:43:13 - INFO    - normcap.gui.tray:618 - Exit normcap
00:43:13 - DEBUG   - normcap.gui.tray:619 - Debug images saved in /tmp/normcap
[phoenix@ArchLinux ~]$ killall kooha 
[phoenix@ArchLinux ~]$ 

@dynobo
Copy link
Owner

dynobo commented Dec 17, 2023

Hi @KAGEYAM4 , again, thanks for your testings.

I finally was able to install Manjaro + Hyprland on an USB drive I can boot to and test myself.
With the (fixed) test build AppImage, the screenshot part works as expected. Here's a screencast with 1.2x scaling: https://ufile.io/h9ymts49

However, I identified two other issues:

1.) DBus org.freedesktop.Notifications seems not to be available, and therefore no Notifications will be shown. Not sure, if it needs to be configured separately, or if it's just not yet implemented in Hyprland.

2.) Copying to clipboard does not work. On Wayland, NormCap relies on xclip for copying to clipboard as in my previous testings it worked more robustly than wl-clipboard. However, on Hyprland, only wl-clipboard seems to work. I will try to fix this in the next release, too.

@KAGEYAM4
Copy link

@dynobo i was wrong again, after seeing your video i tried to cross check, and the cause was resolution being mentioned in my config file explicitly, in yours - you're using auto.

Here's the log ->

[phoenix@ArchLinux ~]$ cd Downloads/
[phoenix@ArchLinux Downloads]$ ./NormCap-0.0.1-x86_64.AppImage -v debug
00:17:58 - INFO    - normcap:49 - Start NormCap v0.5.2
00:17:58 - DEBUG   - normcap:100 - Append /tmp/.mount_NormCaBMWEYi/usr/bin to AppImage internal PATH
00:17:58 - DEBUG   - normcap.gui.tray:79 - System info:
{'normcap_version': '0.5.2', 'python_version': '3.10.13', 'cli_args': '/tmp/.mount_NormCaBMWEYi/usr/app/normcap/__main__.py -v debug', 'is_briefcase_package': True, 'is_flatpak_package': False, 'is_appimage_package': True, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.HYPRLAND: 5>, 'display_manager_is_wayland': True, 'pyside6_version': '6.6.1', 'qt_version': '6.6.1', 'qt_library_path': '/tmp/.mount_NormCaBMWEYi/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCaBMWEYi/usr/python/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/phoenix/.config/normcap'), 'resources_path': PosixPath('/tmp/.mount_NormCaBMWEYi/usr/app/normcap/resources'), 'tesseract_path': PosixPath('/tmp/.mount_NormCaBMWEYi/usr/bin/tesseract'), 'tessdata_path': PosixPath('/home/phoenix/.config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=0, top=0, right=1535, bottom=863, device_pixel_ratio=2.0, index=0, screenshot=None)]}
00:17:58 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
00:17:58 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
00:17:58 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
00:17:58 - DEBUG   - normcap.gui.tray:389 - Listen on local socket v0.5.2-normcap.
00:17:59 - DEBUG   - normcap.screengrab.utils:110 - grim output: stdout=, stderr=
00:17:59 - DEBUG   - normcap.screengrab.utils:119 - Support for grim is available.
00:17:59 - DEBUG   - normcap.screengrab.main:25 - Select capture method grim
00:17:59 - DEBUG   - normcap.screengrab.utils:25 - Virtual geometry width: 1536
00:17:59 - DEBUG   - normcap.screengrab.utils:26 - Image width: 1920
00:17:59 - DEBUG   - normcap.screengrab.utils:27 - Resize ratio: 1.25
00:17:59 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-17_18-47-59_raw_screen0.png
00:17:59 - DEBUG   - normcap.gui.window:148 - Create window for screen 0
00:17:59 - DEBUG   - normcap.gui.window:216 - Set window of screen 0 to fullscreen
00:17:59 - DEBUG   - normcap:176 - [QT] qtwarningmsg - qsystemtrayicon::setvisible: no icon set
00:17:59 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/tmp/.mount_NormCaBMWEYi/usr/bin/tesseract --list-langs --tessdata-dir /home/phoenix/.config/normcap/tessdata'
00:17:59 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/home/phoenix/.config/normcap/tessdata/" (1): ¬ eng ¬
00:17:59 - DEBUG   - normcap.gui.window:207 - Move window 0 to (left=0, top=0, right=1535, bottom=863)
00:18:02 - DEBUG   - normcap.gui.tray:355 - Hide 1 window
00:18:02 - INFO    - normcap.gui.tray:254 - Crop image to region (990, 747, 1220, 802)
00:18:02 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-17_18-48-02_cropped.png
00:18:02 - DEBUG   - normcap.gui.tray:279 - Start OCR
00:18:02 - DEBUG   - normcap.ocr.enhance:84 - Scale image x2
00:18:02 - DEBUG   - normcap.ocr.enhance:57 - Pad image by 80px
00:18:02 - DEBUG   - normcap.ocr.recognize:35 - Run Tesseract on image of size (622, 272) with args:
TessArgs(tessdata_path=PosixPath('/home/phoenix/.config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>)
00:18:02 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/tmp/.mount_NormCaBMWEYi/usr/bin/tesseract /tmp/tmppw4fp59s/normcap_tesseract_input.png /tmp/tmppw4fp59s/normcap_tesseract_input.png -c tessedit_create_tsv=1 -l eng --oem 3 --psm 3 --tessdata-dir /home/phoenix/.config/normcap/tessdata -c tessedit_write_images=1 -c tessedit_dump_pageseg_images=1'
00:18:03 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: 
00:18:03 - DEBUG   - normcap.ocr.tesseract:67 - Skip moving file to temp dir, it does not exist: /tmp/tmppw4fp59s/normcap_tesseract_input.png.png_debug.pdf
00:18:03 - DEBUG   - normcap.ocr.recognize:44 - OCR result:
OcrResult(tess_args=TessArgs(tessdata_path=PosixPath('/home/phoenix/.config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>), words=[{'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 1, 'left': 112, 'top': 118, 'width': 333, 'height': 27, 'conf': 89.538406, 'text': 'Kooha-2023-12-15-...'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 2, 'left': 530, 'top': 120, 'width': 12, 'height': 24, 'conf': 92.135864, 'text': 'k'}], image=<PySide6.QtGui.QImage(QSize(622, 272),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=2488,sizeInBytes=676736) at 0x7ff7c6152400>, magic_scores={}, parsed='')
00:18:03 - INFO    - normcap.ocr.magics.email_magic:60 - 0 emails found 
00:18:03 - DEBUG   - normcap.ocr.magics.email_magic:71 - 0/21 (0.0) chars in emails
00:18:03 - INFO    - normcap.ocr.magics.url_magic:57 - 0 URLs found 
00:18:03 - DEBUG   - normcap.ocr.magics.url_magic:65 - 0/22 (0.0) chars in urls
00:18:03 - DEBUG   - normcap.ocr.magic:82 - Magic scores:
{'SingleLineMagic': 50, 'MultiLineMagic': 0, 'ParagraphMagic': 0.0, 'EmailMagic': 0.0, 'UrlMagic': 0.0}
00:18:03 - DEBUG   - normcap.ocr.recognize:48 - Parsed text:
Kooha-2023-12-15-... k
00:18:03 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-17_18-48-03_enhanced.png
00:18:03 - INFO    - normcap.gui.tray:297 - Text from OCR:
Kooha-2023-12-15-... k
00:18:03 - DEBUG   - normcap.gui.tray:333 - Copy text to clipboard
00:18:03 - DEBUG   - normcap.clipboard.handlers.windll:187 - WindllHandler is incompatible on non-Windows systems
00:18:03 - DEBUG   - normcap.clipboard.handlers.pbcopy:25 - PbCopyHandler is incompatible on non-macOS systems
00:18:03 - DEBUG   - normcap.clipboard.handlers.xclip:43 - XclipCopyHandler is compatible (/tmp/.mount_NormCaBMWEYi/usr/bin/xclip)
00:18:03 - DEBUG   - normcap.clipboard.handlers.wlclipboard:45 - WlCopyHandler is compatible (/usr/bin/wl-copy)
00:18:03 - DEBUG   - normcap.clipboard.handlers.qtclipboard:31 - QtCopyHandler is not compatible with Wayland
00:18:03 - DEBUG   - normcap.clipboard.main:53 - Text copied to clipboard using XclipCopyHandler.
00:18:03 - DEBUG   - normcap.gui.notification:132 - Send notification via notify-send
00:18:03 - DEBUG   - normcap:176 - [QT] qtwarningmsg - the cached device pixel ratio value was stale on window expose.  please file a qtbug which explains how to reproduce.
00:18:08 - INFO    - normcap.gui.tray:618 - Exit normcap
00:18:08 - DEBUG   - normcap.gui.tray:619 - Debug images saved in /tmp/normcap
[phoenix@ArchLinux Downloads]$ ./NormCap-0.0.1-x86_64.AppImage -v debug
00:18:21 - INFO    - normcap:49 - Start NormCap v0.5.2
00:18:21 - DEBUG   - normcap:100 - Append /tmp/.mount_NormCahPIWXV/usr/bin to AppImage internal PATH
00:18:21 - DEBUG   - normcap.gui.tray:79 - System info:
{'normcap_version': '0.5.2', 'python_version': '3.10.13', 'cli_args': '/tmp/.mount_NormCahPIWXV/usr/app/normcap/__main__.py -v debug', 'is_briefcase_package': True, 'is_flatpak_package': False, 'is_appimage_package': True, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.HYPRLAND: 5>, 'display_manager_is_wayland': True, 'pyside6_version': '6.6.1', 'qt_version': '6.6.1', 'qt_library_path': '/tmp/.mount_NormCahPIWXV/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCahPIWXV/usr/python/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/phoenix/.config/normcap'), 'resources_path': PosixPath('/tmp/.mount_NormCahPIWXV/usr/app/normcap/resources'), 'tesseract_path': PosixPath('/tmp/.mount_NormCahPIWXV/usr/bin/tesseract'), 'tessdata_path': PosixPath('/home/phoenix/.config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=1920, top=1080, right=3455, bottom=1943, device_pixel_ratio=2.0, index=0, screenshot=None)]}
00:18:21 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
00:18:21 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
00:18:21 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
00:18:21 - DEBUG   - normcap.gui.tray:389 - Listen on local socket v0.5.2-normcap.
00:18:21 - DEBUG   - normcap.screengrab.utils:110 - grim output: stdout=, stderr=
00:18:21 - DEBUG   - normcap.screengrab.utils:119 - Support for grim is available.
00:18:21 - DEBUG   - normcap.screengrab.main:25 - Select capture method grim
00:18:22 - DEBUG   - normcap.screengrab.utils:25 - Virtual geometry width: 1536
00:18:22 - DEBUG   - normcap.screengrab.utils:26 - Image width: 1920
00:18:22 - DEBUG   - normcap.screengrab.utils:27 - Resize ratio: 1.25
00:18:22 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-17_18-48-22_raw_screen0.png
00:18:22 - DEBUG   - normcap.gui.window:148 - Create window for screen 0
00:18:22 - DEBUG   - normcap.gui.window:216 - Set window of screen 0 to fullscreen
00:18:22 - DEBUG   - normcap:176 - [QT] qtwarningmsg - qsystemtrayicon::setvisible: no icon set
00:18:22 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/tmp/.mount_NormCahPIWXV/usr/bin/tesseract --list-langs --tessdata-dir /home/phoenix/.config/normcap/tessdata'
00:18:22 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/home/phoenix/.config/normcap/tessdata/" (1): ¬ eng ¬
00:18:22 - DEBUG   - normcap.gui.window:207 - Move window 0 to (left=1920, top=1080, right=3455, bottom=1943)
00:18:23 - DEBUG   - normcap.gui.tray:355 - Hide 1 window
00:18:23 - INFO    - normcap.gui.tray:254 - Crop image to region (783, 360, 1532, 757)
00:18:23 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-17_18-48-23_cropped.png
00:18:23 - DEBUG   - normcap.gui.tray:279 - Start OCR
00:18:23 - DEBUG   - normcap.ocr.enhance:84 - Scale image x2
00:18:23 - DEBUG   - normcap.ocr.enhance:57 - Pad image by 80px
00:18:23 - DEBUG   - normcap.ocr.recognize:35 - Run Tesseract on image of size (1660, 956) with args:
TessArgs(tessdata_path=PosixPath('/home/phoenix/.config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>)
00:18:23 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/tmp/.mount_NormCahPIWXV/usr/bin/tesseract /tmp/tmp22ug80tp/normcap_tesseract_input.png /tmp/tmp22ug80tp/normcap_tesseract_input.png -c tessedit_create_tsv=1 -l eng --oem 3 --psm 3 --tessdata-dir /home/phoenix/.config/normcap/tessdata -c tessedit_write_images=1 -c tessedit_dump_pageseg_images=1'
00:18:24 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: 
00:18:24 - DEBUG   - normcap.ocr.tesseract:67 - Skip moving file to temp dir, it does not exist: /tmp/tmp22ug80tp/normcap_tesseract_input.png.png_debug.pdf
00:18:24 - DEBUG   - normcap.ocr.recognize:44 - OCR result:
OcrResult(tess_args=TessArgs(tessdata_path=PosixPath('/home/phoenix/.config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>), words=[], image=<PySide6.QtGui.QImage(QSize(1660, 956),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=6640,sizeInBytes=6347840) at 0x7fa58b1534c0>, magic_scores={}, parsed='')
00:18:24 - INFO    - normcap.ocr.magics.email_magic:60 - 0 emails found 
00:18:24 - DEBUG   - normcap.ocr.magics.email_magic:71 - 0/0 (0) chars in emails
00:18:24 - INFO    - normcap.ocr.magics.url_magic:57 - 0 URLs found 
00:18:24 - DEBUG   - normcap.ocr.magics.url_magic:65 - 0/1 (0.0) chars in urls
00:18:24 - DEBUG   - normcap.ocr.magic:82 - Magic scores:
{'SingleLineMagic': 1, 'MultiLineMagic': 0, 'ParagraphMagic': 200.0, 'EmailMagic': 0, 'UrlMagic': 0.0}
00:18:24 - DEBUG   - normcap.ocr.recognize:48 - Parsed text:

00:18:24 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2023-12-17_18-48-24_enhanced.png
00:18:24 - INFO    - normcap.gui.tray:297 - Text from OCR:

00:18:24 - DEBUG   - normcap.gui.tray:331 - Nothing there to be copied to clipboard!
00:18:24 - DEBUG   - normcap.gui.notification:132 - Send notification via notify-send
00:18:24 - DEBUG   - normcap:176 - [QT] qtwarningmsg - the cached device pixel ratio value was stale on window expose.  please file a qtbug which explains how to reproduce.
00:18:29 - INFO    - normcap.gui.tray:618 - Exit normcap
00:18:29 - DEBUG   - normcap.gui.tray:619 - Debug images saved in /tmp/normcap

Here's a video - https://send.vis.ee/download/e7d53fed31a5a7fd/#_31wl0k4Wo0NVfh1I0UllQ

DBus org.freedesktop.Notifications seems not to be available, and therefore no Notifications will be shown. Not sure, if it needs to be configured separately, or if it's just not yet implemented in Hyprland.

About this i an not sure exactly what this error relates to but i don't think it shows up on mine maybe this is because for notifications on Hypland we have to use dunst or mako.

Copying to clipboard does not work. On Wayland, NormCap relies on xclip for copying to clipboard as in my previous testings it worked more robustly than wl-clipboard. However, on Hyprland, only wl-clipboard seems to work. I will try to fix this in the next release, too.

Same here, i didn't need to install xclip as wl-clipboard was already installed and it was working perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants