RajSolai / TextSnatcher

How to Copy Text from Images ? Answer is TextSnatcher !. Perform OCR operations in seconds on Linux Desktop.
https://textsnatcher.rf.gd/
GNU General Public License v3.0
1.26k stars 45 forks source link

No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop #21

Closed R8s6 closed 2 years ago

R8s6 commented 2 years ago

Hi,

Running on Arch the textsnatcher-git, I got this error:

$ textsnatcher
archtty
** (textsnatcher:203142): CRITICAL **: 12:40:38.143: TesseractTrigger.vala:124: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop

How to reproduce:

  1. Install textsnatcher-git on Arch
  2. Run textsnatcher, "Snatch Now" --> "Take Screenshot"

Could you please kindly investigate? Thanks!

RajSolai commented 2 years ago

What DE are you using Pal ?

R8s6 commented 2 years ago

Xfce.

Thanks!

RajSolai commented 2 years ago

TextSnatcher uses freedesktop's Screenshot portal but it seems the portal is not fully stable in most of DEs. Hence TextSnatcher is moving to different method for screenshot #16 like scrot for X11 systems

R8s6 commented 2 years ago

Thanks. When the fix is out, I'll definitely test it out. Thanks for the hard work!

RajSolai commented 2 years ago

The Release 2.0.0 of TextSnatcher uses scrot based screenshots for x11 system, now TextSnatcher can be used on all x11 based DEs.

R8s6 commented 2 years ago

Thanks!

On Arch, both the textsnatcher (v2.0.0-1) and textsnatcher-git (the last-commit "git" version 2.0.0.r0.g7192ac1-1) still gave the same error:

** (textsnatcher:3101): CRITICAL **: 12:08:38.405: TesseractTrigger.vala:144: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop

Not sure if it's a packaging issue or not, I looked up the packging script (PKGBUILD) of textsnatcher and it seemed fairly straightforward:

...
pkgver=2.0.0
...
source=("$pkgname-$pkgver.tar.gz::https://github.com/RajSolai/TextSnatcher/archive/refs/tags/v$pkgver.tar.gz")

build() {
  arch-meson TextSnatcher-$pkgver build
  meson compile -C build
}

package() {
  meson install -C build --destdir "$pkgdir"

  ln -s "/usr/bin/com.github.rajsolai.$pkgname" "$pkgdir/usr/bin/$pkgname"

I also have scrot installed, tested on xfce (x11, not wayland).

Anything I can do to find out why still the same error?

Thanks!

OnurKader commented 2 years ago

Can you do echo $XDG_SESSION_TYPE and see if it returns x11 or X11.

It might be tty if you're doing some startx related stuff.

This might help out, I haven't tested the config below but I hope it works for you.

[Service]
Environment=XDG_SESSION_TYPE=x11

You can call the file /etc/systemd/system/getty@tty1.service.d/set_session_type.conf or something.

R8s6 commented 2 years ago

Oh that could be why.

$ echo $XDG_SESSION_TYPE
tty

I did use startx to auto-login during boot. I'll poke around and report back.

Thanks!

R8s6 commented 2 years ago

@OnurKader

Yes, I confirm it works out beautifully now.

I normally use the auto-login method described here: https://wiki.archlinux.org/index.php/Getty#Automatic_login_to_virtual_console

Then I edited /etc/systemd/system/getty@tty1.service.d/override.conf by adding exactly what you suggested:

[Service]
Environment=XDG_SESSION_TYPE=x11

Reboot, and it works now.

Thank you so much!