Repository navigation
Replies: 1 comment
|
TextSnatcher already uses the screenshot portal on Wayland, so there is no X11 setting you need to switch on. I found a concrete failure in its current screenshot path: I checked how GLib parses the command line that TextSnatcher builds: python3 - <<'PY'
import ctypes
G=ctypes.CDLL('libglib-2.0.so.0')
G.g_shell_parse_argv.argtypes=[ctypes.c_char_p,ctypes.POINTER(ctypes.c_int),ctypes.POINTER(ctypes.POINTER(ctypes.c_char_p)),ctypes.POINTER(ctypes.c_void_p)]
for label,path in [('unquoted','/tmp/Screenshot from Portal.png'),('quoted',"'/tmp/Screenshot from Portal.png'")]:
n=ctypes.c_int();v=ctypes.POINTER(ctypes.c_char_p)();e=ctypes.c_void_p()
assert G.g_shell_parse_argv(f'tesseract {path} /tmp/out -l eng'.encode(),ctypes.byref(n),ctypes.byref(v),ctypes.byref(e))
print(label,'argument count:',n.value)
G.g_strfreev(v)
PY
unquoted argument count: 7
quoted argument count: 5In |
Uh oh!
There was an error while loading. Please reload this page.
TextSnatcher does not work with the “Take Screenshot” option on Wayland (Error reading image).
One workaround is to take a screenshot the usual way first (PrintSreen Key in my case), then use “Get from Clipboard” option in TextSnatcher.
This is bit frustrating and it produces an additional useless file in the screen captures folder.
Is there any way to have TextSnatcher fully functional on Wayland?
All reactions