3

I often get stalled by the long timeout while typing the first few letters of a file name in Nautilus...

The current timeout seems to be 5 seconds. I'd prefer 1 second ...(as per item 2 on this page about Response Times)

I don't use the mouse much, which means I either wait, or press Escape, when I don't find the file...

I realize that this is a feature to some, but I'd rather not wait.

Is there any way to change this timeout behaviour?

karthick87
  • 81,947
Peter.O
  • 24,681

1 Answers1

6

Unfortunately, the five second delay is hard-coded into Nautilus. Here's how to hack it:

  • First, set up your build environment:

    sudo apt-get install build-essential
    sudo apt-get install devscripts
    sudo apt-get build-dep nautilus
    

    devscripts might ask you to configure Postfix, select anything you want ("No configuration" should be fine, if you don't use Postscript, it shouldn't ask otherwise)

  • Get the source code of Nautilus:

    apt-get source nautilus
    

    (Notice no sudo here)

  • Now to change Nautilus. Open nautilus-2.32.0/libnautilus-private/nautilus-icon-container.c in your favourite text editor. The line we're concerned with is about line 149. It should say:

    #define NAUTILUS_ICON_CONTAINER_SEARCH_DIALOG_TIMEOUT 5
    

    Replace the 5 with any amount of time you like. This must be an integer, and ≥ 1. I've change it to one second, as the article recommends. ;-)

  • Now to build the package:

    cd nautilus-2.32.0/
    sudo debuild
    

    This will take a while. It should, at least. If it finishes with an error like "patch does not remove cleanly", run sudo debuild -nc instead). Note also that this may complain about it not being able to sign the package. You don't need a signed package in this case, they're only required if you want to upload them somewhere.

  • You should now have some .deb packages in the parent directory. Install them all:

    cd ..
    sudo dpkg -i *.deb
    

Afterwards, restart your computer (logging out may be sufficient, I'm not sure), and test the changes. As you know, your changes will be undone with every update of Nautilus.

  • Thanks Stefano... As it turns out, as an answer to one of my questions, I was given some effective directions on how to compile Nautilus... and I managed to do it! ...but actually finding the relevant code would have put it out of the question... So, as you have indicated the code, I'll give it a go.. (The version I am running is already a tweak :) .. Here is the link to the "how to compile Nautilus" question: http://askubuntu.com/questions/7882/can-the-nautilus-properties-page-show-size-in-bytes-for-multiple-selects-and-for – Peter.O Jan 04 '11 at 13:01
  • Notice this is defined in Gtk, not Nautilus. Gtk is the library of graphical tools and widgets that the whole of Gnome, including Nautilus, is built with. – Stefano Palazzo Jan 04 '11 at 13:04
  • Okayyyy :) I see what you mean. This GTK "thing" has been a puzzle to me; (Where does it fit into the overall picture?).. and, please correct me if I'm wrong, but is seems that it is simply a library of functions to do graphical things... and it was a matter of choice that Nautilus chose it.. They could just as well have used Qt.. (if it existed at the genesis of Nautilus)... The "penny has dropped!" ... I'd better leave it alone! ......(I seem to have just repeated what you said, but it took me a while to "get" it .. :) – Peter.O Jan 04 '11 at 14:15
  • There a real picture to correspond with your metaphorical one ;) You're quite right, Gtk is a toolkit full of things that help you develop graphical applications. It was made for the Gimp, but has now become one of the de-facto standard. I'm still working on how to compile gtk, and it's quite easy, were it not for this problem. I'll keep at it. – Stefano Palazzo Jan 04 '11 at 14:18
  • @fred.bear As it turns out, I was wrong - it is defined in Nautilus itself. I've changed the answer now. Please let me know if this works. – Stefano Palazzo Jan 04 '11 at 17:24
  • @Stefano... Well it took me a full day, but I finally got there. I decided to first write a script to automatically graft modified-code snippets into the source-file with significant validation re it replacing the right lines.. .I've got 2 snippets now, I figured that was enough reason to automate it :) ..(again another good venture into the land of bash scripting).. However, although it compiled, this particular mod seems to be acting unchanged.. (my other mod did register and my file sizes now say "Hello 234567 bytes", so the process works.. Thanks for presenting such a helpful explanation. – Peter.O Jan 05 '11 at 15:27
  • That's weird, I'm quite sure this is the correct modification to make. Perhaps it's because I made the same modification in Gtk, but that'd be quite strange (this one has precedence, in this case). In Gtk, the file is gtk+/gtk/gtktreeview.c and the time is given in milliseconds. (Just for reference) – Stefano Palazzo Jan 05 '11 at 15:39