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?

4
  • 1
    Thanks fossfreedom, but this isn't a duplicate - I want to completely and totally remove the Recently Used place from all dialogs. I have no need for it. I never use it and I don't like it.
    – dunderhead
    Feb 14, 2012 at 6:27
  • 3
    This is an obnoxious default. Why would anyone want to scroll through a long list of files, hoping that theirs is there when they could be sent predictably to their home folder, from which any of their required files is likely only a maximum of a couple of clicks away. Additionally, it hinders users from knowing where their files are stored and the moment their file disappears from that list, their crutch is gone and they'll likely spend a painfully long time searching their file system(s) for the file.
    – weberc2
    May 29, 2012 at 15:57
  • 1
    @weberc2 - I agree. This is a crazy default when there's no way to change it! Why force users to have the inconvenience and time-wasting caused by such inflexible design?
    – dunderhead
    May 30, 2012 at 5:35
  • You can change simply the defaults like this (wiki.archlinux.org/title/GTK#File-chooser_start-up_location): gsettings set org.gtk.Settings.FileChooser startup-mode cwd
    – andras.tim
    Dec 17, 2021 at 2:31

6 Answers 6

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);
 }
6
  • Thanks Calamari! This is what's so great about the Linux community. A silly and deliberate bug can be fixed. But due to the way Gnome seems intent on keeping this and other bugs like it, I have installed Debian and XFCE now, and am dual booting while I complete the process of migrating fully away from Ubuntu, Unity and Gnome.
    – dunderhead
    Mar 11, 2013 at 11:31
  • @calamari, Glad to know that my answer helped you in posting a more definitive answer.
    – saji89
    Mar 12, 2013 at 11:39
  • Thanks again Calamari. My process of migration to Debian with XFCE is almost complete, but I was dismayed to find that this nonsense was also happening in apps there. So I followed your excellent instructions and applied your patch. (In case it's helpful for others who might wish to apply the patch: be prepared for it to take a little while - it took about 15 minutes on my machine.) I'm delighted to report that it worked! But, oddly, there's one app that I've found which stubbornly refuses to play nicely: Gedit! That's not a problem, though; I'll just uninstall Gedit and use something else.
    – dunderhead
    Mar 28, 2013 at 10:29
  • After the patch, Synaptic is reporting libgtk2.0-dev as being broken. Do you have any recommendations as to what I should do about this?
    – dunderhead
    Mar 28, 2013 at 10:39
  • I used Synaptic to automatically fix the broken package and all now seems okay.
    – dunderhead
    Mar 28, 2013 at 18:07
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.

2
  • 1
    Thank you, saji89, for your informative and helpful post and the link to the excellent article by Tim Starling. Inflexible and, for me, silly UI design like this is why I've been trying Debian LXDE and XFCE recently. I'm fed up with the way that Ubuntu and Gnome are heading and I fear it's only going to get worse so I've decided to move on.
    – dunderhead
    Apr 24, 2012 at 17:20
  • dunderhead, really sorry to hear that. Apart from such idiotic bugs, I feel that Ubuntu and gnome are heading towards the future itself. Just that I'm still on the Ubuntu side of things and kind of like the new Unity interface. yes they're thinking in daring ways, better said as "Out of the box". But that doesn't justify such silly bugs. Thankfully the choice is always ours. :)
    – saji89
    Apr 25, 2012 at 6:57
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!

1
  • Thank you Sarvesh, but I already have that installed. What I would like is for the Recent Documents to be removed from all dialogs thereby saving me thousands of unnecessary clicks per year! When I want to open a file I have to click my home directory to navigate away from the empty and therefore useless 'recent documents' directory to which the dialogs are defaulting.
    – dunderhead
    Apr 13, 2012 at 11:35
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
2
  • 1
    Thanks BlueXrider but that's not what I was after. I've already disabled history. Save and Open dialogs default to Recently Used in the left pane, but I'd prefer them to default to my home or better still a directory of my choosing.
    – dunderhead
    Feb 17, 2012 at 11:18
  • 2
    I find it to be doubly disturbing when a save dialog defaults to recently used instead of the actual directory of the file. There may be times when I use save as just to find out what directory the file is actually in for some programs. Also, if I want to save a backup, I will probably want it to be in the same directory as the file itself. Recently used should, at least, always show the current file's directory at the top as the default. Mar 6, 2012 at 17:58
-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.

3
  • There are some additional activity files in this folder, like activity.sqlite.bck, activity.sqlite-shm and activity.sqlite-wal. activity.sqlite.bck seems to be the backup. Don't know what the others do, but I think it's save to just delete them too.
    – kamshi
    Jan 17, 2013 at 10:51
  • 1
    What is mkdir ~/.local/share/zeitgeist/activity.sqlite supposed to do?
    – user25656
    Jan 17, 2013 at 17:29
  • ^ The trick is to create a directory instead of a file so apps will fail to read and write that.
    – s3v3n
    Jan 24, 2013 at 9:36
-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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .