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.

When I click on a word attachment in an email I have received in gmail from chromium, it always opens the file using abiword. How can I persuade it to use libreoffice instead? I am using lubuntu 12.10.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Chromium uses xdg-open to open the application for a file type. So, all you need to do is adjust your xdg configuration, or in other words change the default application that handles a particular file type.

To associate a particular application to a file type or Mime Type (MIME stands for Multipurpose Internet Mail Extensions), we make an entry in ~/.local/usr/share/applications/mimeapps.list stating that a particular application to be opened when a file with the correspoding mime type is opened.

I've provided sources below, in case you want to know more about mime types

In this case, do the following:

  • Open a terminal (Ctrl+Alt+T).
  • Run the following command to make an entry:
xdg-mime default libreoffice-writer.desktop application/vnd.oasis.opendocument.text application/vnd.oasis.opendocument.text-template application/vnd.oasis.opendocument.text-web application/vnd.oasis.opendocument.text-master application/vnd.sun.xml.writer application/vnd.sun.xml.writer.template application/vnd.sun.xml.writer.global application/msword application/vnd.ms-word application/x-doc application/x-hwp application/rtf text/rtf application/vnd.wordperfect application/wordperfect application/vnd.lotus-wordpro application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.ms-word.document.macroenabled.12 application/vnd.openxmlformats-officedocument.wordprocessingml.template application/vnd.ms-word.template.macroenabled.12 application/vnd.ms-works application/vnd.stardivision.writer-global application/x-extension-txt application/x-t602 text/plain 

In case, you've Libreoffice 4 installed, run:

xdg-mime default libreoffice4.0-writer.desktop application/vnd.oasis.opendocument.text application/vnd.oasis.opendocument.text-template application/vnd.oasis.opendocument.text-web application/vnd.oasis.opendocument.text-master application/vnd.sun.xml.writer application/vnd.sun.xml.writer.template application/vnd.sun.xml.writer.global application/msword application/vnd.ms-word application/x-doc application/x-hwp application/rtf text/rtf application/vnd.wordperfect application/wordperfect application/vnd.lotus-wordpro application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.ms-word.document.macroenabled.12 application/vnd.openxmlformats-officedocument.wordprocessingml.template application/vnd.ms-word.template.macroenabled.12 application/vnd.ms-works application/vnd.stardivision.writer-global application/x-extension-txt application/x-t602 text/plain 
  • You might need to logout and login again for the changes to take effect.

Further information & Sources:

share|improve this answer
    
That's great, thanks. Is this long command line really the recommended way to change application preferences for chromium? –  Raphael Feb 25 '13 at 7:59
    
You can choose which file type to open, for example if you only want to open MS Word files to open using Libreoffice Writer, you can write xdg-mime default libreoffice-writer.desktop application/msword –  green7 Feb 25 '13 at 11:02
add comment

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.