A quick-and-dirty LD_PRELOAD hack that allows *some* Gtk applications to use KDE's file dialogs.
KGtk project is a quick-and-dirty LD_PRELOAD hack that allows *some* Gtk applications to use KDE's file dialogs when run under KDE.
The Gtk file chooser functions have been overridden to communicate with this KDE module/application.
After compiling and installing this, you can run Gtk applications in 2 ways:
A. call /usr/local/bin/kgtk-wrapper gimp
B. i. Create a symbolic link from the wrapper script to your application, e.g.
ln -s /usr/local/bin/kgtk-wrapper /usr/local/bin/gimp
ii. Make sure /usr/local/bin is before /usr/bin (or wherever gimp is installed) in your $PATH
iii. Now simply run 'gimp' - this should find the wrapper script first.
If this works OK, then edit the .desktop file (e.g. /usr/share/applications/gimp.desktop) to have "Exec=/usr/local/bin/[appname]" instead of "Exec=[appname]", e.g. for gimp.desktop this would be:
Exec=/usr/local/bin/kgtk-wrapper gimp-remote-2.2 %U
So far I have tested this with the following applications:
1. Kino. Works perfectly - in fact Kino was my main reason for doing this.
2. Firefox. Works with Firefox 1.5, but *not* Firefox 1.0.x
3. GIMP. Again, seems to work just fine. However, there is no progress bar on file loading - as GIMP uses a progress bar embedded in the file chooser.
4. Inkscape. Works OK - at least 0.43
5. Streamtuner - the folder browser button works.
6. AbiWord - does *not* work. Don't even try...
7. Glade2. Seems to work OK, however I have had it crash when loading Kino's .glade file, but not always. So I'm not sure if this is Glade's fault, or mine.
8. Eclipse. Will work only if dlsym can be overriden
As the only Gtk apps I use are Kino, GIMP, and a little of Firefox, this library works great for me. Your millage may vary, and please note that this is only a quick hack to get things working now for me. I'm not sure how stable it will be under heavy usage, so don't be surprised if it breaks. However, if it does break - the only thing that should happen is that the Gtk apps will fall back to using the standard Gtk dialogs.
The 'Portland' freedesktop project will undoubtedly come up with a far better solution. But until then, you can give this a try.
- Gtk3 support.
- Better, and safer, lookup of file filters.
- Correctly determine size of string needed for pidfile!
- Add thunderbird, and LibreOffice apps, to list of gtk2 apps.
- Cleanup usless stuff; remove kdialogd3, qt3, qt4, kgtk2-wrapper, kqt3-wrapper, kqt4-wrapper.
- Merge kgtkXX-wrapper scripts into kgtk-wrapper
- Install kdialogd4 into KDE4 libexec dir.
- Fix crash where client is terminated whilst file dialog is open.
- Configurable debug. Pass cmake -DKGTK_DEBUG=true
- When starting app, set KGTK_DEBUG env var, e.g.