Is there a way I can block a folder from Gnome and/or Unity search?

I sometimes browse erotic media files, and I have some of them stored in my hard drive. All said content is saved in one specific folder.

Is there a way I can block this folder from Gnome and/or Unity search?

I've heard 'use a separate user', but that won't work, as the files will still be in my hdd, plus; I often browse said files and work at the same time (kinda... lol).

So, in short, I want to block (blacklist) a certain folder from Dash.

Its bad enough that I don't like gnome3 or the unity interface, I want to like gnome3, but this little thing is really a big deal to me.

Hope I can get some help here.

EDIT: I seem to have successfully blacklisted the folder I wanted to blacklist, and somehow managed to delete the (previous to blacklisting) "recently used" files.

I've entered so much crap into terminal, and installed so much stuff that I actually don't know what the trick was. So, I plan on:

  • Formatting my machine (as I always do when a new version is out)
  • Reinstall Ubuntu 11.10 i386 (I own a 64bit machine, and 4gb of ram, but in my experience, software, like wine, has trouble working on 64bits, so, I'll keep working with 3.8GB instead of 4 for now).
  • Install the Gnome3 environment.
  • Find out exactly what it is that is needed to be done.
  • Update this very question with a full, appropriate answer.

Thanks to the next linked (related) Q&A's, that in some way helped me out; and I haven't got a clue which one was the ultimate answer for Ubuntu Unity/Gnome3 11.10 (as some of this were answered for 11.04, in which, I used ubuntu classic login):

  • How can I keep recent files from appearing in Unity?
  • How can I prevent certain directories/files from appearing in Unity's dash?

Solution 1:

OK, so; I formatted my HDD again, just to start from scratch again. Here's the whole story:

After successfully installing Ubuntu 11.10 i386 on my Lenovo T400 ThinkPad;

  1. Install dependencies (needed for Google Chrome and Gnome Shell)

    sudo apt-get -f install
    
  2. Install Gnome Shell

    sudo apt-get install gnome-shell
    
  3. Install Gnome Tweak Tool

    sudo apt-get install gnome-tweak-tool
    

    Once installed, it should show up as "Advanced Settings" in the menu.

  4. Optional Install Gnome Contacts

    Note: not included in Ubuntu, but somehow shows some contacts in DASH as search results; but won't open anything when clicked, unless you install this.

    sudo apt-get install gnome-contacts
    
  5. Optional Install Gnome Sushi (a MacOS X'-ish spacebar file previewer)

    sudo apt-get install gnome-sushi
    

Here's the important part, as of now, if I dare search "hard"... I'll get a mixed bag from hardware apps to other kind of hard stuff I wouldn't want to be shown in there.

So, let's install Activity Log Manager:

  • Install Activity Log Manager

    sudo add-apt-repository ppa:zeitgeist/ppa
    sudo apt-get update
    sudo apt-get install activity-log-manager
    

After this, I added "the folder" to the "pseudo-blacklist", and no luck. That's because this would only block it out of the Activity Log. Not Dash, and not search.

  • Install Activity Journal

This one is nothing but the GUI for Zeitgeist.

At this point; nothing has happened. Dash still shows whatever I'd browsed before, and whatever I browse now, will show.

  • Remove the "recently used" file, and turn it into a folder (right?)

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

After this last step; Dash won't shoe your previously browsed files, and, won't show your new browes files, plus, activity log manager won't be tracking whatever you set it to. No more "Recently opened" section in Dash, and now the beautiful Activity Journal will actually be useful!

Done! This actually worked for me, at least has until now (just a couple of hours), hopefully, it'll stay that way. If it stops working, I suppose I'll let you know.

Apparently, Sean Houlihane was right, thanks man.

Solution 2:

Why don't you keep your private files in a hidden folder? You make a hidden folder by giving it a name that starts with a period (.) For example: .mystuff

You can see these folders by pressing ctrl+H, or by going to View > Show hidden files in the Nautilus menu. (I guess those are the words in English)

Gnome shouldn't display the content in those folders.

Solution 3:

There DOES need to be an easy method of doing PRECISELY this.

I review 'questionable' content, as part of my job (information security).

I see NO need for a graphic sneak-peak for all RECENT image files, or even ALL recent files.

THIS should actually be a opt-in application, with ONLY this folders (and sub-folders) indexed and presented. This should also provide multiple contexts. eg. development, home/private, business.

If we are still allowing to organize their folders and files, then we need to be able to control how these files are accessed or remembered.

I adapted a solution from the other posted question:

How can I keep recent files from appearing in Unity?