Ubuntu – way to add to the “Recently Used” list (that appears in file dialogs) from the command-line

command linefilesplaces

I have certain scripts that create files (often from keyboard shortcuts) and I would like to have the files they create appear in the "Recently Used" section of file open dialogs. Is there a way to add to this list from the command-line?

For example, I have a script that runs scrot with certain options to take a screenshot. I would like the resulting screenshot to then appear in the "Recently Used" section of file open dialogs.

Best Answer

A script to do this can be found in the recently_used github repo. Usage is pretty straightforward:

$ recently_used.py foo.txt bar.png

This adds the files foo.txt and bar.png to the recently used list used by GTK+ apps.