28

I never use Recently Used file lists; I have a filing system so I know where I want to open and save files.

I've read this question:

Can I stop apps from selecting "Recently Used" by default in file chooser dialogs?

However, I just want this option completely removed.

It's an annoyance to have to keep navigating away from the default.

Failing the above is there a way to make my home directory the default?

6 Answers6

7

Thanks to saji89 for linking to the affected files. In case anyone still cares about this (and also for myself, because a recent upgrade allowed it to slip back in), I've created a patch (http://pastebin.com/VE4STB6M) to fix this annoying misfeature. The patched gtk will still show "Recently Used" in dialogs, but it will not be selected in the dialogs by default (it will default to the last directory used or to your home directory). For me, this fixes the problem, because my main gripe was having it pop up in my face, especially when trying to save something.

Step by step instructions:

1) Open a terminal window and enter the following commands:

mkdir recently_used_fix

cd recently_used_fix/

sudo apt-get build-dep gtk+2.0

apt-get source gtk+2.0

wget -O deselect_recently_used.patch http://pastebin.com/download.php?i=VE4STB6M

patch -p0 < deselect_recently_used.patch

cd gtk+2.0-2.24.10/

echo jlj | dpkg-source --commit

sudo dpkg-buildpackage

cd ..

2) Close any package managers (such as Synaptic) and enter the following command in the terminal window:

sudo dpkg -i *.deb

3) If the dpkg -i command gives errors about overwriting a handful of existing files (changelogs and such), use sudo rm FILENAME to delete each file it complained about, then repeat step 2. I noticed --force-overwrite doesn't seem to work for that, for whatever reason.

4) Optional: Once the packages are successfully installed, use Synaptic to pin/hold (Package > Lock Version) each installed package, to avoid having to go through all this again (of course you would also miss any security updates).

5) Close and re-open any affected apps (pluma, gedit, gimp, etc) and enjoy your annoyance-free open/save dialogs!

6) Optional: Enter the following commands in the terminal window to remove the files and directories we created (the fix will remain installed):

cd ..

sudo rm -rf recently_used_fix/

In case the patch cannot be downloaded, here is a backup copy:

--- gtk+2.0-2.24.10/gtk/gtkfilechooserdefault.c 2011-11-08 10:20:20.000000000 -0700
+++ Downloads/gtk/gtk+2.0-2.24.10/gtk/gtkfilechooserdefault.c   2012-07-10 17:20:38.000000000 -0700
@@ -5971,10 +5971,18 @@ gtk_file_chooser_default_map (GtkWidget

   if (impl->operation_mode == OPERATION_MODE_BROWSE)
     {
+      GFile *folder;
+
       switch (impl->reload_state)
         {
         case RELOAD_EMPTY:
-     recent_shortcut_handler (impl);
+          /* The user didn't explicitly give us a folder to display, so we'll
+           * use the saved one from the last invocation of the file chooser
+           */
+          folder = get_file_for_last_folder_opened (impl);
+          gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (impl), folder, NULL);
+          g_object_unref (folder);
+     /* recent_shortcut_handler (impl); */
           break;

         case RELOAD_HAS_FOLDER:
@@ -6005,8 +6013,8 @@ gtk_file_chooser_default_unmap (GtkWidge

   settings_save (impl);

-  cancel_all_operations (impl);
-  impl->reload_state = RELOAD_EMPTY;
+  /* cancel_all_operations (impl);
+  impl->reload_state = RELOAD_EMPTY; */

   GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->unmap (widget);
 }
3

It is literally impossible to do it, as the code related to that is hard-coded into the gedit codebase.

This is the relevant gedit commit message related to this change in the Gedit code- http://git.gnome.org/browse/gtk+/commit/?id=ca74dc6a873bb375bb2abc3ea7642ed41e9f6e79

Courtesy:http://tstarling.com/blog/2011/11/file_chooser_recent/

So, unless someone changes the code for this and alter it to a user settable setting, I'm sorry to say that there seems no direct way out.

saji89
  • 12,187
0

I think this is what you are looking for: http://www.addictivetips.com/ubuntu-linux-tips/how-to-delete-and-disable-recent-history-in-ubuntu-tip/

To delete recent history, open the Terminal and enter the commands below:

rm ~/.local/share/zeitgeist/activity.sqlite
zeitgeist-daemon --replace

To prevent new items from being created, use these commands:

echo -n > ~/.recently-used.xbel
sudo chattr +i ~/.recently-used.xbel

You can revert the changes to enable logging again by using the following Terminal command:

sudo chattr -i ~/.recently-used.xbel

Some systems might store the recently used file in another location:

echo -n > ~/.local/share/recently-used.xbel
sudo chattr +i ~/.local/share/recently-used.xbel
Dave Jarvis
  • 991
  • 2
  • 12
  • 26
Ringtail
  • 16,285
0

I dont know if this will do exactly what u need but i think it might solve your issue.

You need a software called Activity Log Manager

sudo add-apt-repository ppa:zeitgeist/ppa 
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install activitylogmanager

Find activity Log manager in the dash and run it.

Further Information is available at OMG Ubuntu!

sarvesh.lad
  • 2,534
-1

I found a way to at least prevent zeitgeist from creating a history at all (I think):

rm ~/.local/share/zeitgeist/activity.sqlite
mkdir ~/.local/share/zeitgeist/activity.sqlite

Since then I have had no activity of mine logged in any way, including a "recently used" dialog. Sadly, it still pops up, but at least it won't tell which folders I visited recently. I do not like it when I'm permanently monitored, even if it is my own machine.

The worst thing of all is that even if you disable logging in zeitgeist and clear the history, it does a incomplete job and still happily logs some activities.

Mateo
  • 8,152
kamshi
  • 1
-1

This is a three-years' old thread, but it seems like the GTK2 peeps made it a configuration option.

Go into ~/.config/gtk-2.0/gtkfilechooser.ini, and set StartupMode=cwd. It doesn't rid you of the silly thing, but at the very least, it becomes not-the-default.

Note: I didn't find this in the documentation; the above patch failed, and when I investigated why, I found the devs had made it possible without compiling the thing.

Fordi
  • 319