14 Mar 2014 shlomif   » (Master)

Tech Tip: Resetting the GLib/Gtk+ Default Apps on Linux (e.g: the Default Browser)

In this tip, I would like to describe how to reset the default apps, and especially the default browser, for GLib and GTK+. These are used by desktops like GNOME and XFCE, and by GTK+ applications such as HexChat or claws-mail. My problem originally was that I accidentally pressed the "Yes" button when Firefox Nightly (installed under a prefix under /opt) asked me whether I should set it as the default browser, which caused HexChat and Claws-Mail to open links using it by default.

Anyway, to resolve this problem do this:

  1. Go to ~/.local/share/applications.

  2. Backup this directory somewhere safe.

  3. The mimeapps.list file contains the reference to use the offending apps under the *.desktop files there which you can search for the reference to the apps.

  4. Remove these line or their portions from mimeapps.list.

Now you may need to restart the desktop apps or the desktop environment (not sure).

Hope it helps.

Here’s how I found it: after some false leads of either trying to recursively search my home directory for occurrences of /opt/firefox and reading the source code of HexChat, GLib and gtk+ to see where this happens (there were too many levels of indirection there), I ended up doing “strace -f -o hexchat.strace hexchat” and inspecting the strace file for hints.

Licence

You can reuse this entry under the Creative Commons Attribution 3.0 Unported licence, or at your option any later version. See the instructions of how to comply with it.

Syndicated 2014-03-08 11:31:14 from shlomif

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!