Support Xreader, refresh support for Evince #1557
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I use Mint which by default ships with Xreader (and a symlink
evince
->xreader
), so I was looking to add Xreader support for #1366 . Xreader seems to be just a fork of Evince, so most of the previous script works, but not completely. So I ended up rewriting it completely to support both, also because it was quite old.dbus_viewers/sync
which can open a document, check if the document is open, do forward search, or wait for sync source signals and call back ST, or any combination of the previous. It does everything via DBus, like the previousevince_forward_sync
andevince_backward_search
did, with some tweaks:GetWindowList
, because it seems that is not implemented inXreader
, but that is unnecessary becauseFindDocument
will anyways give us the opened document, and from there we can get the main window (which is in both cases at index 0)bring_evince_forward
in the same way as before, that is, calling Evince and hoping that it will not create duplicate windows. Maybe other alternatives likewmctrl
can be considered too. I extended the support toXReader
, so now the setting is calledbring_forward
(but for evince, it will fallback tobring_evince_forward
)sync
script) per PDF file which stays alive and calls back sublime text when the synchronization is requested. If the user closes the viewer and the reopens it, the monitor process reattaches and is able to synchronize.BaseDBusViewer
, which inherits fromBaseViewer
and gives them the same behavior, except for the different DBus name and command. In the case of Mint, if Xreader is used in lieu of Evince, theEvinceViewer
will adjust the DBus name for running correctly.I tested this on Mint 20.2, with ST4 build 4126, Evince 3.36.10, XReader 3.0.2. I use Cinnamon as desktop.
I tested all combinations of usage parameters for the script (with and without fwd sync, with and without bwd sync, with and without opening the document, with both editors), jump/build/view pdf with both editors, and backward sync from both editors.
I'm looking for feedback especially on the following:
bring_evince_forward
tobring_forward
in this way?Let me know what you think :)