Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to make Firefox accept bash commands to handle an application protocol?

Currently, I am opening irc:// links in XChat from Firefox via a shell script as described in this answer. I would like to eliminate the script step and directly move on to opening the link in XChat.

share|improve this question
Can you please give an example of what you're trying to achieve? – arrange Sep 9 '11 at 15:33
Well, I do not understand how the command itself will make a difference to the way to get Firefox to run it, but edited in the thing I command I want to run. – Oxwivi Sep 9 '11 at 16:41

You said you wanted to skip the shell script part. Basically you can execute the content of every shell skript like this:

bash -c "contents of shell script in one line"

In your case it would look like this:

bash -c "xchat --existing --url=\"%s\""

Since xchat is an executable independet of bash you should be able to start xchat directly:

/usr/bin/xchat --existing --url="%s"

Use which xchat to find out where xchat is installed on your system and replace the /usr/bin part if it is installed somewhere else.

share|improve this answer
Yes, I know the command itself (and it's /usr/bin/xchat by the way), but what I want to know is how to get Firefox to actually take commands instead just the path to directory. – Oxwivi Sep 11 '11 at 8:15

Please see this old post, it helped other people before:

P.S.: read the entire thread.

share|improve this answer
I already tried that suggested in a Ubuntu Forums thread. No luck. – Oxwivi Sep 9 '11 at 19:15
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – RolandiXor Sep 17 '11 at 16:52

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.