1 |
root |
1.1 |
=head1 GTK+ BASH FILE CHOOSER |
2 |
|
|
|
3 |
root |
1.2 |
Gtk+ is a nice toolkit, but ever since the new file chooser was introduced |
4 |
|
|
in version 2, it became less and less usable. Not only is tab completion |
5 |
|
|
gone (at least in a useful form), quickly entering a path has become |
6 |
|
|
impossible due to many extra keys one has to press and due to the extreme |
7 |
|
|
slowness of the file chooser itself. |
8 |
|
|
|
9 |
|
|
As an example, when firefox finds a new filetype (e.g. a pdf) and I use |
10 |
|
|
its file chooser to select F</usr/bin/xpdf>, here is what happens: After |
11 |
|
|
typing F</usr/bin> the app freezes for around 40 seconds. Then it has |
12 |
|
|
loaded F</usr/bin> (this is on a typical debian install, F<ls -l /usr/bin> |
13 |
|
|
is much faster). Then after pressing return to select it, the window |
14 |
|
|
again freezes for about 30 seconds. In the gtk+ 1.0 file selector this |
15 |
|
|
took less than a second. As another example, when I save an image in |
16 |
|
|
the GIMP to F</tmp>, I can actually see the Gtk+ file chooser accessing |
17 |
|
|
other, automounted, paths such as F</fs/cdrom>, or F</fs/doom>, which |
18 |
|
|
are my dvd drive and an nfs fs on anoher machine. Mounting those takes |
19 |
|
|
additional time to the time required scanning F</tmp> (which again is |
20 |
|
|
about a minute). |
21 |
|
|
|
22 |
|
|
Clearly, this makes the Gtk+ file chooser completely |
23 |
|
|
unusable. Unfortunately, despite many people having opened bug reports |
24 |
|
|
about these problems, they are either getting ignored, or fixed in an |
25 |
|
|
half-assed attempt just to come back in the next gtk+ release. |
26 |
|
|
|
27 |
root |
1.1 |
B<gtkbfc> is a hack that replaces the dreaded, slow and hard-to-use GTK+ |
28 |
|
|
file chooser by a rxvt-unicode window with a little script that you to use |
29 |
|
|
readline tab-completion to enter filenames. |
30 |
|
|
|
31 |
|
|
Again, its a dire hack and will not work with all programs. It does work |
32 |
root |
1.2 |
for gimp, firefox, gedit at least, though. Most importantly, it does work |
33 |
|
|
for me, which really is all that counts. |
34 |
|
|
|
35 |
root |
1.1 |
|
36 |
|
|
=head2 INSTALLATION |
37 |
|
|
|
38 |
|
|
Install rxvt-unicode. Then copy the F<gtkbfc-helper> to F</etc/> and make |
39 |
|
|
sure its executable and opens a window where you can enter a filename when |
40 |
|
|
executed as F</etc/gtkbfc-helper>, which will then be echod to stdout. |
41 |
|
|
|
42 |
|
|
Then run F<make>, this will create a F<gtkbfc.so> shared object. You |
43 |
|
|
have to specify this shared object as LD_PRELOAD when running gtk |
44 |
|
|
programs. Either manually: |
45 |
|
|
|
46 |
|
|
LD_PRELOAD=/path/to/gtkbfc.so gimp |
47 |
|
|
|
48 |
|
|
Via an alias: |
49 |
|
|
|
50 |
|
|
alias gimp='LD_PRELOAD=/path/to/gtkbfc.so gimp' |
51 |
|
|
|
52 |
|
|
Or by putting it into your F</etc/ld.so.preload> (not really recommended |
53 |
|
|
for performance reasons). |
54 |
|
|
|
55 |
root |
1.2 |
|
56 |
|
|
=head2 BUGS |
57 |
|
|
|
58 |
|
|
You want to use readline, so you are some kind of guru anyways, so if you |
59 |
|
|
have a bug report, better attach a patch or a very thorough analysis of |
60 |
|
|
what goes wrong to your e-mail. Thank you very much. |
61 |
|
|
|
62 |
|
|
|
63 |
root |
1.1 |
=head2 AUTHOR |
64 |
|
|
|
65 |
|
|
Marc Lehmann <gtkbfc@schmorp.de>. |