Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I installed wxMaxima on my laptop a few days ago.

The issue is that files with the extension .wxm, that are used with wxMaxima, are identified as a C source files. Therefore, when I double click on such a file, it opens my text editor.

I tried right clicking on a .wxm file, and changing the default program — but that also changed the default program for .c extensions — something I don't want to happen.

The bottom line: how do I define .wxm extension to be of a different type than .c extensions?

share|improve this question

Important: I suppose that your desktop environment or file manager runs a program based on file mime type.

Interestingly, my file command returned ASCII C program text for .wxm file. Definitly, this was not correct, and I have corrected this in the following way:

Suppose your home directory is /home/user

  1. Create /home/user/.magic with the following contents:

    0       string  /*\ [wxMaxima\ batch\ file      wxMaxima batch file
    !:mime  text/x-wxmaxima-batch
  2. Compile magic by running file -C -m /home/user/.magic — it will create /home/user/.magic.mgc file

  3. Check that file command works as expected:

    user@host$ file wxmaxima_file.wxm
    wxmaxima_file.wxm: wxMaxima batch file
    user@host$ file -i wxmaxima_file.wxm
    wxmaxima_file.wxm: text/x-wxmaxima-batch; charset=us-ascii
  4. Set up your desktop environment or file manager to run wxMaxima based on text/x-wxmaxima-batch mime type. (The precise way how to do this depends on such a desktop environment or file manager. So if you do not know such a details, you may ask another question.)

share|improve this answer

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.