Glam Prestige Journal

Bright entertainment trends with youth appeal.

Is it possible to set the default application to open a file by extension rather than mimetype?

MuseScore saves its files as .mscz files, which are actually just zip-archives containing the data of the MuseScore file. Since Ubuntu recognizes it as a zip-archive, it opens them with the archive manager. So I always have to right-click and say Open with MuseScore, which is annoying.

If I set MuseScore as default for the .mscz files, it becomes the default for all zip-archives, which is obviously not what I want. So it would be useful if I could set MuseScore as default for all files with the .mscz extension.

As far as I know, I don't have any .mscz archives that are not MuseScore files, so that wouldn't be a problem. And if I ever do encounter some, I don't mind dealing with that.

1 Answer

Try the following:

  1. Use nano to create the /usr/share/mime/packages/musescore3.xml file:

    sudo nano /usr/share/mime/packages/musescore3.xml
  2. Copy and paste (with Ctrl+Shift+V) the following:

    <?xml version="1.0" encoding="UTF-8"?>
    <mime-info xmlns=""> <mime-type type="application/x-musescore3"> <comment>MuseScore file</comment> <sub-class-of type="application/zip"/> <glob pattern="*.mscz"/> </mime-type> <mime-type type="application/x-musescore3+xml"> <comment>uncompressed MuseScore file</comment> <sub-class-of type="application/xml"/> <glob pattern="*.mscx" /> </mime-type> <mime-type type="application/vnd.recordare.musicxml3"> <!-- --> <_comment>compressed MusicXML file</_comment> <sub-class-of type="application/zip"/>
    <!-- Note: a custom icon is used for MusicXML files. You can change this below -->
    <!-- <icon name="application-x-musescore"/> Uncomment to use MuseScore file icon -->
    <!-- <generic-icon name="audio-x-generic"/> Uncomment to use generic audio file icon --> <glob pattern="*.mxl"/> </mime-type> <mime-type type="application/vnd.recordare.musicxml3+xml"> <!-- --> <_comment>uncompressed MusicXML file</_comment> <sub-class-of type="application/xml"/>
    <!-- <icon name="application-x-musescore"/> Uncomment to use MuseScore file icon -->
    <!-- <generic-icon name="audio-x-generic"/> Uncomment to use generic audio file icon --> <magic> <match type="string" value="&lt;?xml" offset="0"> <match type="string" value="score-partwise" offset="0:128"/> <match type="string" value="score-timewise" offset="0:128"/> </match> <match type="string" value="&lt;!--" offset="0"> <match type="string" value="score-partwise" offset="0:128"/> <match type="string" value="score-timewise" offset="0:128"/> </match> </magic> <glob pattern="*.xml" weight="40"/> </mime-type> <mime-type type="application/vnd.recordare.musicxml3+xml"> <!-- --> <_comment>uncompressed MusicXML file</_comment> <sub-class-of type="application/xml"/> <!-- <icon name="application-x-musescore"/> Uncomment to use MuseScore file icon --> <!-- <generic-icon name="audio-x-generic"/> Uncomment to use generic audio file icon --> <magic> <match type="string" value="&lt;?xml" offset="0"> <match type="string" value="score-partwise" offset="0:128"/> <match type="string" value="score-timewise" offset="0:128"/> </match> <match type="string" value="&lt;!--" offset="0"> <match type="string" value="score-partwise" offset="0:128"/> <match type="string" value="score-timewise" offset="0:128"/> </match> </magic> <glob pattern="*.musicxml" weight="40"/> </mime-type>
    </mime-info>
  3. Save and close nano using Ctrl+O and Ctrl+X.

  4. Run:

    sudo update-mime-database /usr/share/mime
  5. Then right-click a .mscz file and then go to PropertiesOpen With → select MuseScore from the list → Set as default.

  6. If that doesn't work immediately, repeat step 5 to set the default program (Archive Manager) for a zip file and then repeat for Musescore.

The following screenshot is an example of the Properties window.

Properties

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy