Gtk+ is a nice toolkit, but ever since the new file chooser was introduced in version 2, it became less and less usable. Not only is tab completion gone (at least in a useful form), quickly entering a path has become impossible due to many extra keys one has to press and due to the extreme slowness of the file chooser itself.
As an example, when firefox finds a new filetype (e.g. a pdf) and I use its file chooser to select /usr/bin/xpdf, here is what happens: After typing /usr/bin the app freezes for around 40 seconds. Then it has loaded /usr/bin (this is on a typical debian install, ls -l /usr/bin is much faster). Then after pressing return to select it, the window again freezes for about 30 seconds. In the gtk+ 1.0 file selector this took less than a second. As another example, when I save an image in the GIMP to /tmp, I can actually see the Gtk+ file chooser accessing other, automounted, paths such as /fs/cdrom, or /fs/doom, which are my dvd drive and an nfs fs on anoher machine. Mounting those takes additional time to the time required scanning /tmp (which again is about a minute).
Clearly, this makes the Gtk+ file chooser completely unusable. Unfortunately, despite many people having opened bug reports about these problems, they are either getting ignored, or fixed in an half-assed attempt just to come back in the next gtk+ release.
gtkbfc is a hack that replaces the dreaded, slow and hard-to-use GTK+ file chooser by an rxvt-unicode window with a little script that lets you use readline tab-completion to enter filenames.
Again, it's a dire hack and will not work with all programs. It does work for gimp, firefox, gedit at least, though. Most importantly, it does work for me, which really is all that counts.
The default helper requires rxvt-unicode for terminal input. Other terminals won't do because they close all extra filehandles (and also do not support the less important --transient-for switch). As the helper is just a shell script you could rewrite it to use another mechanism to fetch the filename (such as a temporary file). Anything goes as long as the helper outputs an absolute pathname on stdout and exits.
The default helper also requires bash, as it has a read built-in that is readline-enabled. Again, you can easily modify the helper script to use another hsell, or another mechanism.
Install rxvt-unicode. Then copy the gtkbfc-helper to /etc/ and make sure it's executable and opens a window where you can enter a filename when executed as /etc/gtkbfc-helper, which will then be echod to stdout.
Then run make, this will create a gtkbfc.so shared object. You have to specify this shared object as LD_PRELOAD when running gtk programs. Either manually:
LD_PRELOAD=/path/to/gtkbfc.so gimp
Via an alias:
alias gimp='LD_PRELOAD=/path/to/gtkbfc.so gimp'
Or by putting it into your /etc/ld.so.preload (not really recommended for performance reasons).
gtkbfc works by overriding the constructor for the GtkFileChooserWidget which is used in most file chooser applications. That is actually the clean part. The unclean part simply replaces some of the file chooser methods by methods that either do nothing or return the filename from the last invocation of the gtkbfc helper program.
The original file chooser is kept in the background but is disabled, and is generally nonfunctional. To avoid minutes of file system scanning, gtkbfc redirects the gtk+ file chooser to an empty file in an otherwise empty directory in /tmp.
You want to use readline, so you are some kind of guru anyways, so if you have a bug report, better attach a patch or a very thorough analysis of what goes wrong to your e-mail. Thank you very much.
Marc Lehmann <gtkbfc@schmorp.de>.