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 open irc:// links in pidgin from chromium.

When i am logged-in to a irc server(irc.freenode.net) running purple-url-handler irc://irc.freenode.net/#ubuntu in terminal works fine.

But when i click the same link in chromium (which uses xdg-open to open irc:// links) it does nothing. Any idea how to make this happen?

I am using Ubuntu 12.04.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

OK I found it!So I will answer here.

FOR UBUNTU(>=11.04)

Gconf settings(/desktop/gnome/url-handlers) didn't do anything since as of Natty the file-open functionality is handled by gvfs-open, which doesn't use gconf settings. Rather, gvfs-open looks at the ".desktop" files bundled with each application to determine what file types can be handled.if it is not installed, run :

   sudo apt-get install gvfs-bin

In all x-scheme handler urls( like irc://, xmpp://, sip://, aim://) are handled by purple-url-handler.We are going to create a desktop file for it.

gksudo gedit /usr/share/applications/purple-url-handler.desktop

& put following content in it:

[Desktop Entry]
Name=Purple URL Handler
GenericName=Internet Messenger
Comment=URL handler forGoogle Talk, Jabber/XMPP, MSN, Yahoo and more
Exec=purple-url-handler %U
Icon=pidgin
StartupNotify=true
Terminal=false
Type=Application
MimeType=x-scheme-handler/irc;
Categories=Network;InstantMessaging;
X-Ubuntu-Gettext-Domain=pidgin

Now to make irc:// links open with purple-url-handler run :

xdg-mime default purple-url-handler.desktop x-scheme-handler/irc

This informator is stored in ~/.local/share/applications/mimeapps.list.

Now when you click any irc:// link in chromium for the first time, the following prompt will appear:

chromium-prompt

Select remember my choice & launch application. If you are already logged in it will open the room in pidgin.

DONE!

share|improve this answer
    
Probably better to use MimeType=x-scheme-handler/aim;x-scheme-handler/gg;x-scheme-handler/gtalk;x-sche‌​me-handler/icq;x-scheme-handler/irc;x-scheme-handler/msnim;x-scheme-handler/myim;‌​x-scheme-handler/sip;x-scheme-handler/xmpp;x-scheme-handler/ymsgr; and announce every protocol it supports to the associations system. (I'd also use NoDisplay=true so it doesn't duplicate Pidgin's appearance in the menus) –  ssokolow Dec 4 '12 at 9:58

Your Answer

 
discard

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.