dynobo / normcap

OCR powered screen-capture tool to capture information instead of images
https://dynobo.github.io/normcap/
Other
1.8k stars 91 forks source link

Flatpak notifications are shown as hidden #594

Open faveoled opened 5 months ago

faveoled commented 5 months ago

What happened?

In AppImage I see the contents of recognized text presented to me but in Flatpak I have to click on my notifications panel to see it

How did you install NormCap?

Flatpak

Operating System + Version?

Ubuntu 22.04.3

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

Xorg, Gnome

Debug log output?*


$ flatpak run com.github.dynobo.normcap -v debug
13:46:30 - INFO    - normcap:49 - Start NormCap v0.5.4
13:46:30 - DEBUG   - normcap.gui.tray:77 - System info:
{'normcap_version': '0.5.4', 'python_version': '3.11.5', 'cli_args': '/app/bin/normcap -v debug', 'is_briefcase_package': False, 'is_flatpak_package': True, 'is_appimage_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.GNOME: 1>, 'display_manager_is_wayland': False, 'pyside6_version': '6.6.1', 'qt_version': '6.6.1', 'qt_library_path': '/usr/share/runtime/lib/plugins, /app/lib/python3.11/site-packages/PySide6/Qt/plugins, /usr/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/user/.var/app/com.github.dynobo.normcap/config/normcap'), 'resources_path': PosixPath('/app/lib/python3.11/site-packages/normcap/resources'), 'tesseract_path': PosixPath('/app/bin/tesseract'), 'tessdata_path': PosixPath('/home/user/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': '/app/share', 'LD_LIBRARY_PATH': ''}, 'screens': [Screen(left=0, top=0, right=1365, bottom=767, device_pixel_ratio=1.0, index=0, screenshot=None)]}
13:46:30 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
13:46:30 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
13:46:30 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
13:46:30 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (clipboard_handler: None)
13:46:30 - DEBUG   - normcap.gui.tray:388 - Listen on local socket v0.5.4-normcap.
13:46:30 - DEBUG   - normcap.screengrab.main:20 - Select capture method QT
13:46:30 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2024-01-18_10-46-30_raw_screen0.png
13:46:30 - DEBUG   - normcap.gui.window:52 - Create window for screen 0
13:46:30 - DEBUG   - normcap.gui.window:128 - Set window of screen 0 to fullscreen
13:46:30 - DEBUG   - normcap:183 - [QT] qtwarningmsg - qsystemtrayicon::setvisible: no icon set
13:46:30 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/app/bin/tesseract --list-langs --tessdata-dir /home/user/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'
13:46:30 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/home/user/.var/app/com.github.dynobo.normcap/config/normcap/tessdata/" (1): ¬ eng ¬
13:46:34 - DEBUG   - normcap.gui.tray:354 - Hide 1 window
13:46:34 - INFO    - normcap.gui.tray:246 - Crop image to region (326, 85, 758, 115)
13:46:34 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2024-01-18_10-46-34_cropped.png
13:46:34 - DEBUG   - normcap.gui.tray:271 - Start OCR
13:46:34 - DEBUG   - normcap.ocr.enhance:84 - Scale image x2
13:46:34 - DEBUG   - normcap.ocr.enhance:57 - Pad image by 80px
13:46:34 - DEBUG   - normcap.ocr.recognize:35 - Run Tesseract on image of size (1026, 222) with args:
TessArgs(tessdata_path=PosixPath('/home/user/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO: 3>)
13:46:34 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/app/bin/tesseract /tmp/tmpq_b1o4in/normcap_tesseract_input.png /tmp/tmpq_b1o4in/normcap_tesseract_input.png -c tessedit_create_tsv=1 -l eng --oem 3 --psm 3 --tessdata-dir /home/user/.var/app/com.github.dynobo.normcap/config/normcap/tessdata -c tessedit_write_images=1 -c tessedit_dump_pageseg_images=1'
13:46:35 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: 
13:46:35 - DEBUG   - normcap.ocr.tesseract:67 - Skip moving file to temp dir, it does not exist: /tmp/tmpq_b1o4in/normcap_tesseract_input.png.png_debug.pdf
13:46:35 - DEBUG   - normcap.ocr.recognize:44 - OCR result:
OcrResult(tess_args=TessArgs(tessdata_path=PosixPath('/home/user/.var/app/com.github.dynobo.normcap/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': 93, 'top': 102, 'width': 124, 'height': 30, 'conf': 92.023209, 'text': 'flatpak'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 2, 'left': 238, 'top': 110, 'width': 50, 'height': 16, 'conf': 92.966293, 'text': 'run'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 3, 'left': 308, 'top': 102, 'width': 449, 'height': 30, 'conf': 91.294647, 'text': 'com.github.dynobo.normcap'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 4, 'left': 780, 'top': 110, 'width': 31, 'height': 16, 'conf': 92.239014, 'text': '-v'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 5, 'left': 830, 'top': 102, 'width': 88, 'height': 30, 'conf': 96.20919, 'text': 'debug'}], image=<PySide6.QtGui.QImage(QSize(1026, 222),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=4104,sizeInBytes=911088) at 0x7f97a94f3880>, magic_scores={}, parsed='')
13:46:35 - INFO    - normcap.ocr.magics.email_magic:60 - 0 emails found 
13:46:35 - DEBUG   - normcap.ocr.magics.email_magic:71 - 0/42 (0.0) chars in emails
13:46:35 - INFO    - normcap.ocr.magics.url_magic:57 - 0 URLs found 
13:46:35 - DEBUG   - normcap.ocr.magics.url_magic:65 - 0/46 (0.0) chars in urls
13:46:35 - DEBUG   - normcap.ocr.magic:82 - Magic scores:
{'SingleLineMagic': 50, 'MultiLineMagic': 0, 'ParagraphMagic': 0.0, 'EmailMagic': 0.0, 'UrlMagic': 0.0}
13:46:35 - DEBUG   - normcap.ocr.recognize:48 - Parsed text:
flatpak run com.github.dynobo.normcap -v debug
13:46:35 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2024-01-18_10-46-35_enhanced.png
13:46:35 - INFO    - normcap.gui.tray:289 - Text from OCR:
flatpak run com.github.dynobo.normcap -v debug
13:46:35 - DEBUG   - normcap.gui.tray:332 - Copy text to clipboard
13:46:35 - DEBUG   - normcap.clipboard.handlers.windll:187 - WindllHandler is incompatible on non-Windows systems
13:46:35 - DEBUG   - normcap.clipboard.handlers.pbcopy:24 - PbCopyHandler is incompatible on non-macOS systems
13:46:35 - DEBUG   - normcap.clipboard.handlers.qtclipboard:34 - QtCopyHandler is compatible
13:46:35 - DEBUG   - normcap.clipboard.handlers.wlclipboard:34 - WlCopyHandler is not compatible on non-Linux systems and on Linux w/o Wayland
13:46:35 - DEBUG   - normcap.clipboard.handlers.xclip:38 - XclipCopyHandler is compatible
13:46:35 - DEBUG   - normcap.clipboard.main:84 - Compatible clipboard handlers: ['qt', 'xclip']
13:46:35 - DEBUG   - normcap.clipboard.handlers.qtclipboard:38 - QtCopyHandler requires no dependencies
13:46:35 - DEBUG   - normcap.clipboard.handlers.xclip:43 - XclipCopyHandler is not installed: xclip was not found
13:46:35 - DEBUG   - normcap.clipboard.main:89 - Available clipboard handlers: ['qt']
13:46:35 - DEBUG   - normcap.clipboard.handlers.qtclipboard:34 - QtCopyHandler is compatible
13:46:35 - DEBUG   - normcap.clipboard.main:56 - Text copied to clipboard using 'qt.' handler
13:46:35 - DEBUG   - normcap.gui.notification:170 - Send notification via QT
13:46:39 - INFO    - normcap.gui.tray:610 - Exit normcap
13:46:39 - DEBUG   - normcap.gui.tray:611 - Debug images saved in /tmp/normcap```