Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to use xdg-open to open irc:// links, how can I make the required parameter?

share|improve this question
related bug: bugs.launchpad.net/ubuntu/+source/xchat/+bug/917118 –  cweiske Jan 16 '12 at 11:54
you can get help from this question "How can I open irc:// links in Pidgin from Chromium?" –  Khurshid Alam Nov 13 '12 at 9:33

1 Answer 1

up vote 11 down vote accepted

xdg-open basically just looks to see which desktop environment you have and then runs gnome-open, gvfs-open, xfce-open, etc. See below for desktop environment specific instructions...


Gnome uses the gnome-open program which uses gconf to store everything. For example on my machine with Ubuntu 10.10 running gnome-open irc://blah opens up xchat because xchat includes a gconf setting patch to add an irc:// handler.

gconf-editor showing irc with xchat configuration

This shows how gnome does this, with a gconf settings in /desktop/gnome/url-handlers/. See xchat-2.8.8/src/common/dbus/apps_xchat_url_handler.schemas as an example.


For KDE you should look at the .protocol files in /usr/share/kde4/services/, create a new one for your new protocol and put it in ~/.kde/share/kde4/services/, if it's super useful then consider adding it to the package as a fix for other users.

KDE is using kde-open or kfmclient depending on what's available and what version of KDE you have.


XFCE uses a program called exo-open, this program doesn't have any way to configure it or add uri handlers. Looking through the source code shows that is uses desktop files to specify only three types of programs. TerminalEmulator, WebBrowser and EmailClient.

With XFCE4 (and probably also others) it is possible to configure xdg-open to define a custom protocol handler. In some you have to create/edit the following files:

~/.local/share/applications/protocolhandler.desktop ~/.local/share/applications/mimeapps.list

An example adding a handler for the ed2k protocol is provided at stackexchange.com2.

share|improve this answer
Can you mention how to do that for all official DEs? –  Oxwivi Sep 22 '11 at 20:17
Not exactly related to the question, but can you quote in full the directory at the bottom of the screen shot? Thank you. –  Oxwivi Sep 23 '11 at 13:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.