Code Monkey home page Code Monkey logo

Comments (10)

amka avatar amka commented on September 27, 2024

The error is quite descriptive itself: your system doesn't provide the required environment variable - XDG_DATA_HOME.
The Frog implies having access to this var because of https://docs.flatpak.org/es/latest/conventions.html#xdg-base-directories.

You could try to put it in your profile to make Frog work properly.

from frog.

yochananmarqos avatar yochananmarqos commented on September 27, 2024

Ah, turns out user directory variables are not set by default. I added them to my ~/.profile.

โฏ echo $XDG_DATA_HOME
/home/yochanan/.local/share

However, I'm receiving the exact same error.

from frog.

yochananmarqos avatar yochananmarqos commented on September 27, 2024

If I run XDG_DATA_HOME="$HOME/.local/share/" frog, I'm getting somewhere. However, it can't find eng.traineddata because it's looking in /app/share/appdata/ instead of /usr/share/appdata/ or /usr/share/tessdata/. It seems to be hardcoded in language_manager.py.

Traceback (most recent call last):
  File "/usr/bin/frog", line 52, in <module>
    sys.exit(main.main(VERSION))
  File "/usr/lib/python3.9/site-packages/frog/main.py", line 121, in main
    app = Application()
  File "/usr/lib/python3.9/site-packages/frog/main.py", line 61, in __init__
    language_manager.init_tessdata()
  File "/usr/lib/python3.9/site-packages/frog/language_manager.py", line 163, in init_tessdata
    copyfile(source_path, dest_path)
  File "/usr/lib/python3.9/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/app/share/appdata/eng.traineddata'

It appears it's trying to copy eng.traineddata from /usr/share/appdata/ to ~/.local/share/tessdata/. I copied it there manually and the application runs.

However, selecting Grab the area closes the window and does not allow me to select anything.


(frog:616852): Gtk-CRITICAL **: 12:27:10.731: gtk_bin_remove: assertion 'priv->child == child' failed
Cache downloaded codes, ['eng']
ERROR: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: SelectArea is not allowed (9)
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/frog/window.py", line 221, in on_shot_error
    self.on_screenshot_error(error)
TypeError: on_screenshot_error() missing 1 required positional argument: 'error'

from frog.

amka avatar amka commented on September 27, 2024

Soon I'll release new version to Flathub. It won't require access to the home folder and also use libportal to take screenshots. I'm not the user of Manjaro but hope it will help.

from frog.

yochananmarqos avatar yochananmarqos commented on September 27, 2024

Sounds good. ๐Ÿ‘

Technically, my issue has nothing to do with Manjaro or any other distribution. The point is, it isn't currently compatible with installing from source code using sane specifications and guidelines.

from frog.

amka avatar amka commented on September 27, 2024

Ah, that's true. I designed it specifically for elementary OS and have no thought on support the other distros. But the time has come and the Frog is moving towards any compatible (I mean with Screenshot Portal) distro.

from frog.

yochananmarqos avatar yochananmarqos commented on September 27, 2024

It's working now with the latest commit with a couple workarounds. Here's my PKGBUILD.

from frog.

yochananmarqos avatar yochananmarqos commented on September 27, 2024

FYI, I've added it to the AUR as frog-ocr and let users know they need to set the XDG_DATA_HOME variable.

from frog.

amka avatar amka commented on September 27, 2024

Actually, Frog doesn't use XDG_DATA_HOME since 1.0 so doesn't need that notice :)

from frog.

yochananmarqos avatar yochananmarqos commented on September 27, 2024

What do you mean? If ~/.local/share/tessdata/eng.traineddata does not exist it's created on launch. Without the variable set, it can't find where to create it.

Not sure why it needs to do that at all as it's in /usr/share/tessdata/ as part of tesseract-data-eng.

from frog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.