I am looking for a tray icon indicator that – upon click on the icon – shows me the list of my recently used files. This would be a great way to quickly access these files.
Ubuntu – n indicator to quickly access recently used files
filesindicatorsoftware-recommendationsystem-trayunity
Related Question
- Ubuntu – Why do indicator applets exist
- Ubuntu – ny Ubuntu translation indicator
- Ubuntu – Where are the files and dirs “recently used” stored
- Ubuntu – No Skype tray icon in Ubuntu 15.04
- Ubuntu – Missing tray icon indicator in recent Spotify versions
- Ubuntu – way to add to the “Recently Used” list (that appears in file dialogs) from the command-line
- Ubuntu – How to hide the “An error occurred” tray indicator icon
Best Answer
Have your recently used files in the panel
With the script below, you can have an arbitrary number of recently used items at hand in the panel, e.g. 6 items:
...or 20 items:
...depending on your settings.
How it works
The setup exists of two items:
recent.png
Both need to be in one and the same folder. after that, simply run the script.
How to set up
Possibly, you need to install
python3-gi
:Then:
Copy the script below into an empty file, save it as
recused.py
In the head section of the script, set the number of items to show:
In one and the same folder save the icon below as (exactly)
recent.png
(right-click on it -> save as)
Test- run the script by the command:
If all works fine, add to Startup Applications: Dash > Startup Applications > Add. Add the command:
Notes
.desktop
file.recently-used.xbel
file, sometimes a file is mentioned twice; once with, and once without extension. I solved that by filtering the latter out. The consequence is that files without extension won't appear in the list. If that is an issue, let me know, we can try to find another fix in that case.recently-used.xbel
file.Explanation
Many applications, editing files and using a Gtk window, keep track of opened files in the file:
~/.local/share/recently-used.xbel
. "Records" include the date & time, the application and the file that was opened.The script reads the
.xbel
file, sorts the items by date/time, includes the first n- (depending on your settings) files in the menu of the indicator. The menu is updated (only if necessary) every 3 seconds as it is. Subsequently, when an item is selected, the file is opened with the command:Thus the selected file will be opened with the default application. It is very well possible to make sure the file is opened with the actual application it was last opened. That takes a somewhat more sophisticated parsing however. I will add that as an option to the planned ppa version on Launchpad.
The same goes for an option window to set a few options, like the number of files to show etc.
Note
The indicator is now merged with a few other things in this one.