4

I would like to access (to view) the list of "Recently viewed" in Evince documents from the terminal, without starting Evince. Or maybe can I find a text document where this list is stored? I am using Ubuntu 16.04.

Paradisally, I would like to find a complete list of Evince documents opened during the previous session or at least a history file, where opened documents are listed together with the dates of opening or at least in the order of opening.

Can you guys help me with this?

Update: Unfortunately, in my system recently-used.xbel is a really short file. It is just 218 bytes and contains nothing related to Evince.

  • When I open Evince after an unexpected shutdown, the list of "Recently viewed" documents appears. How can I view this list without accessing Evince? – user10805276 Dec 18 '18 at 11:31
2

By running strace -e open evince some.pdf I was able to find the path used and it is

~/.local/share/recently-used.xbel

I have verified that this is the case for both 14.04 and 16.04. This file contains recently used items from many applications, so you'd need to filter it by application name. The file is in XML format, so if you want any sort of automated processing it needs to involve an XML parser.

  • Thank you for the answer! Unfortunately, in my system recently-used.xbel contains nothing at all related to Evince – user10805276 Dec 18 '18 at 17:30
  • @user10805276 Maybe you didn't open anything with evince recently. I suggest you just try the strace command yourself to see if it uses a different path on your system (I don't see why it would though). – kasperd Dec 18 '18 at 18:56
  • Will strace change access logs of Evince or access logs to Evince? If no, then I will try it. Yes, there had been about a dozen of pdf files opened with Evince during the previous session. The first of them was opened several months ago and the last one just a day before the shut down. In fact, on another computer recently-used.xbel is indeed full of data with many "Recently viewed" files recorded. I do not know why nothing is recorded on the computer I am working with. – user10805276 Dec 18 '18 at 20:12
  • @user10805276, grep evince ...recently-used.xbel ? it might be useful to update evince... – JJoao Dec 18 '18 at 20:38
  • @user10805276 Do you have more than one username on the machine? Maybe you were using a different username. Or maybe evince wasn't given a chance to save its recently viewed list. And running strace -e open evince some.pdf will do exactly the same that evince some.pdf. Only difference is that you also get some additional output in the terminal. – kasperd Dec 18 '18 at 21:43
0

(first Install xidel xml/xpath processor if not yet installed)

~/.local/share/recently-used.xbel is an XML document with bookmarks of recently used documents.

In order to extract the filenames of the evince entries, we must provide a XPath expression that:

  • looks for bookmarks with attribute name = "Document Viewer",
  • and print the href for levels up
xidel -e '//*[@name="Document Viewer"]/../../../../@href' ~/.local/share/recently-used.xbel
  • Thank you for the answer! Unfortunately, in my system recently-used.xbel contains nothing at all related to Evince – user10805276 Dec 18 '18 at 17:30
  • @user10805276, try to locate recently-used.xbel – JJoao Dec 18 '18 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.