Ken (Chanoch) Bloom's Blog

20th September 2010

Using GNOME default browser setting without running gnome-session

GTK+ has an API gtk_show_uri for launching a web browser or other helper application to view URLs. This API call uses GIO to determine what programs to use for which protocols. However this only works if you're running gnome-session. I don't want to run all of GNOME on my desktop, so I needed a different solution.

For those who want to use the GNOME default web browser to visit URIs in GTK+ applications, but do not want to run a full GNOME session yourself, the workaround is to set the environment variable GIO_USE_URI_ASSOCIATION=gconf. (I discovered this by reading http://library.gnome.org/devel/gio/stable/ch03.html and experimenting a bit).

I'm sure the procedure for using the XFCE4 default web browser is similar, but I don't know the name of the GDesktopAppInfoLookup implementation to use.

Permalink | linux.
My Website Archives

Tags