Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I wanted to start mutt in terminal when I click on some mailto: tag in a webpage. Is that possible? Currently Firefox starts, which I really don't favor; it's slow loading and unnecessary.

share|improve this question

migrated from Aug 16 '11 at 13:23

This question came from our site for system and network administrators.

First you need to ensure that there's a .desktop file which is required by the XDG specification. For GUI programs the chance is good that there already is a suitable .desktop file, for terminal applications usually you have to create your own one. Check out the directory /usr/share/applications for existing files. Maybe there is already a mutt.desktop file. If there isn't, create one.

Then edit the file ~/.local/share/applications/mimeapps.list and add the following line

[Default Applications]

This registers mutt with the mailto handler. You can confirm a successful registration with

xdg-mime query default 'x-scheme-handler/mailto'

which should output mutt.desktop. Now you can click on “mailto” in chromium and a terminal should pop up with a mutt instance. No need to even restart the desktop session or the browser.

share|improve this answer

You need to write a script that's specifies the terminal that you want mutt to open in. Then, in Firefox, you can associate this script with mailto links. For example, if you are using terminator, you can create the following script.

#!/usr/bin/env bash
terminator -x "mutt '$@'"

In my case, I have a persistent drop-down terminator, so I want it in a new tab. I also need a 256 colour palette, so I use

#!/usr/bin/env bash
terminator --new-tab -x "TERM=xterm-256color; mutt '$@'"

FWIW this is my full script, which also unhides terminator (if hidden), using the shortcut Ctrl+Space, and brings it to the front.

#!/usr/bin/env bash

terminator --new-tab -x "TERM=xterm-256color; mutt '$@'"

# If necessary, unhide and focus terminator window.
windowlist=$(xprop -root | sed -rn 's/_NET_CLIENT_LIST_STACKING\(WINDOW\): window id # (.*)/\1/p' | tr -d ',')
for i in $windowlist; do
  [[ $(xprop -id $i | grep WM_CLASS\(STRING\)) == 'WM_CLASS(STRING) = "terminator", "Terminator"' ]] && terminator_visible=true && term_id=$i

if [[ $terminator_visible == false ]]; then # it's hidden
  xdotool key --clearmodifiers ctrl+space
elif [[ $(xprop -id $(xdotool getactivewindow) | grep WM_CLASS\(STRING\)) != 'WM_CLASS(STRING) = "terminator", "Terminator"' ]]; then # it's visible, but not active
  xdotool windowactivate $term_id 2> /dev/null # Gives error; not sure why. XGetWindowProperty[_NET_WM_DESKTOP] failed (code=1)
share|improve this answer

Which desktop environment are you running? You need to check it's MIME type handler's settings on how to set a specific handler for these kind of things.

share|improve this answer
OpenBox , i just don't know how to get the mimetype , it's not a file , i can't just run 'mimetype /path/to/file' to identify it – warl0ck Aug 16 '11 at 12:55

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.