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
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
/opt) asked me whether I should set it as the default
browser, which caused HexChat and Claws-Mail to open links using it by
Anyway, to resolve this problem do this:
Backup this directory somewhere safe.
mimeapps.listfile contains the reference to use the offending apps under the
*.desktopfiles there which you can search for the reference to the apps.
Remove these line or their portions from
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.