You are not logged in.

#1 2021-05-20 05:07:54

MrNeuneu
Member
Registered: 2018-05-01
Posts: 22

dbus not working on org.gnome.evince.Daemon

Hi,

I am trying to make evince work with atom (the editor), but I have some problems.
The issue seems to be that when the FindDocument method of `org.gnome.evince.Daemon` is called, it timeouts.
I have no idea how to fix this problem and I didn't find any documentation online.

Here is what I type.

dbus-send --print-reply --session --dest=org.gnome.evince.Daemon /org/gnome/evince/Daemon org.gnome.evince.Daemon.FindDocument 'string:file:///home/user/Desktop/testtex/test.pdf' boolean:true

Then I wait a bit and get the following answer (independently of the file existing or not).

Error org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying

If I replace the boolean by "false", I get an instantaneous answer but nothing happens and it prints.

method return time=1621485396.173403 sender=:1.148 -> destination=:1.147 serial=3 reply_serial=2
   string ""

If instead I call the method RegisterDocument, I get the same answer. If I call the method UnregisterDocument (with the same document), it says

Error org.freedesktop.DBus.Error.InvalidArgs: URI not registered

I don't know what these methods are supposed to do, and I have no idea how to debug that. I thought the issue might be that I don't use gnome desktop, but the same problem happens with org.x.reader.Daemon and org.mate.atril.Daemon.

Does anybody have an idea for debugging that?

Last edited by MrNeuneu (2021-05-20 07:29:46)

Offline

#2 2021-05-20 06:29:09

MrNeuneu
Member
Registered: 2018-05-01
Posts: 22

Re: dbus not working on org.gnome.evince.Daemon

I noticed that what I am trying to do works when the document is already opened in evince. I thought this dbus command should open evince, maybe it is not the case? In any case, I just have to open the document with evince before calling dbus, so I mark it as solved.

Offline

#3 2021-05-20 06:47:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,334

Re: dbus not working on org.gnome.evince.Daemon

Why are you not just using

evince $file

? That dbus will only work when evince is already started (as it is the provider of that DBUS endpoint)

Offline

#4 2021-05-20 07:21:45

MrNeuneu
Member
Registered: 2018-05-01
Posts: 22

Re: dbus not working on org.gnome.evince.Daemon

Thanks for your answer. Maybe I should explain more the context. I am trying to fix the atom package atom-latex, more specifically this file. From that file and its dependencies, I inferred that dbus should open a new evince window if there is none with the requested document. Since that doesn't work like this on my system, I thought it was the problem. Otherwise, I don't understand how this code is supposed to open evince for the first time if it's not already running. So you confirm dbus doesn't launch a new evince instance?

My solution to make atom work was simply to add a line to launch evince if it's not running.

Offline

#5 2021-05-20 07:28:07

MrNeuneu
Member
Registered: 2018-05-01
Posts: 22

Re: dbus not working on org.gnome.evince.Daemon

I believe that this dbus command should open a new evince window. For instance, here, it is said it does if I understand correctly (the paragraph that starts with "This part works, much to my surprise.", they speak about a new evince window).

PS: I unmarked as solved.

Last edited by MrNeuneu (2021-05-20 07:30:06)

Offline

Board footer

Powered by FluxBB