Quite a few applications use ~/.local/share/recently-used.xbel
to keep track of a user’s most recent files. Unfortunately, not every application offers customization options to disable this list.
One possible solution, granted, a quite hacky one, is to clear recently-used.xbel
and revoke a user’s permission to edit it again.
First, remove and re-create the file to clear it
$ rm -f ~/.local/share/recently-used.xbel $ touch ~/.local/share/recently-used.xbel
You can then edit the permission so that the user can’t edit the file any more.
$ chmod -w ~/.local/share/recently-used.xbel
For KDE, there is quite a similar mechanism. While there is no single file that stores the recently used items, a .desktop
file is created in ~/.kde/share/apps/RecentDocuments/
for every item.
If if you revoke a user’s writing permission to that folder, KDE won’t add any item to the ‘recently used’ list.
$ chmod -w ~/.kde/share/apps/RecentDocuments/
Thank You for this hack 😉
I hope zeitgeist will become the only backend for all recently used files for all applications 🙂
@LordGiotto You’re welcome 😉
Regarding zeitgeist, I can only second that! However, I’m afraid there’ll always remain some exceptions.
Thanks for the hack. KDE no longer lists my recent documents but it still lists recent applications. Do you know how I can prevent this?
I have tried that but it does not work
my command is chmod -w ~/.kde4/share/apps/RecentDocuments/
i did not work then I removed all permissions to the folder, chmod 000 /Re.., but still, when I open a file, i keeps adding recent documents @@
The only thing that worked for me was the crude cludge of deleting the file recently-used.xbel and creating a directory with the same name; thus preventing the file being recreated again.
I usually do cat /dev/null > filename to clear a file.
This worked for me kde 5 plasma:
rm -r ./.local/share/RecentDocuments
mkdir ./.local/share/RecentDocuments
chown nobody:nobody ./.local/share/RecentDocuments
chmod a-w ./.local/share/RecentDocuments