Disable Recent Documents in Gnome 2.22.3

So even Windows lets you disable the Recent Documents feature, but for some reason Gnome really wants to remember what files you’ve been messing with. Personally I never use this menu item (usually under Places in the Gnome Main Menu) and find it to be a bit of a privacy concern.

Surprisingly enough there are no documented settings for Recent Documents, not even something in gconf-editor, so people have been going stone age to prevent this functionality. In the past you could change permissions for the file that stores the data in your home directory, but it seems in later versions of Gnome the following is the current method of choice.

METHOD:

Enter the following into a terminal:
[sourcecode language=’bash’]rm ~/.recently-used.xbel
mkdir ~/.recently-used.xbel[/sourcecode]

When you’re done, go check your menu and Recent Documents should be grayed out.

This works because the data concerning your recent documents can’t be written to a directory and the Recent Documents menu item is simply disabled. (I played around with retaining the text file and changing its permissions, but they were eventually always overwritten.)

NOTES:

It has been mentioned that you may receive GTK related warnings in the console after applying this, since we did a sort of end-run that’s kind of expected.

There was another method that involved making the file immutable (sudo chattr +i ~/.recently-used.xbel) but this is only for ext2/ext3 filesystems (I prefer JFS whenever applicable).

There may also be a left over file, ~/.recently_used that you can also remove:

[sourcecode language=’bash’]rm ~/.recently-used[/sourcecode]

SOURCES:

Arch Linux Forums /  Disable Gnome Recent Documents [solved]

Disable recent documents – Ubuntu Forums

I take no responsibility for coming up with this hack, I just wanted to clearly document it. BTW, this has been a problem since 2005 > Bug 30942 – Request to add option to disable ‘Recent Documents’ lists

4 Replies to “Disable Recent Documents in Gnome 2.22.3”

  1. And here’s a simple script to toggle it:

    ##############################
    ### ~/bin/recent_documents ###
    ##############################
    #!/bin/bash

    if ! [ -d ~/.recently-used.xbel ]; then
    mv ~/.recently-used.xbel ~/.recently-used.xbel.backup 2>/dev/null
    mv ~/.recently-used ~/.recently-used.backup 2>/dev/null
    mkdir ~/.recently-used.xbel && recent_status=”disabled”

    else
    rmdir ~/.recently-used.xbel && recent_status=”enabled”
    mv ~/.recently-used.xbel.backup ~/.recently-used.xbel 2>/dev/null
    mv ~/.recently-used.backup ~/.recently-used 2>/dev/null

    fi

    [ “${recent_status}” ] && echo “Recent documents menu ${recent_status}.”

Leave a Reply

Your email address will not be published. Required fields are marked *