Here are some tips that finally worked for me. See
http://www.freedesktop.org/wiki/Specifi ... gMIMETutor for a tutorial.
First, I used assogiate (
http://www.kdau.com/projects/assogiate/) to make the process easier under Gnome. There are other alternatives; assogiate was available in Synaptic.
Second, I added a user type text/x-vensim with filename pattern *.mdl.
Third, I ran
Code: Select all
$ update-mime-database ~/.local/share/mime/
.
Fourth, I opened Nautilus and navigated to a .mdl file in my Linux filesystem, right-clicked on it, and selected properties. It came up as a Vensim model file (the description I had entered), and the MIME type was text/x-vensim.
Fifth, I selected the Open With tab and added the script I had created previously to start Vensim in Wine.
Sixth, I tested it by double-clicking the file in Nautilus and selecting Display, and it worked. When I selected Run, nothing happened. Actually, I think I would have been happier had it opened in gedit when I selected Open and in Vensim when I selected Run, but this is still progress. Since anything that ends in .mdl is now recognized as text/x-vensim, this works on other models, too.
Now for the final test: opening it from a PDF file.
I opened my slides (contained in the same directory) in xpdf from the command line (makes it easier to see what happens). Hovering my mouse over the link causes xpdf to show the file name. I click on it, and I see
in the terminal window. When I close xpdf, I see
Code: Select all
XtUngrabButton(drawArea,3,0)
Warning: Attempt to remove nonexistent passive grab
in the terminal window.
Bummer.
I try the same thing with evince. When I hover my mouse over the link, I get a popup that says
. I click on the link, and nothing happens.
More bummer.
I go back to assogiate and change the MIME category to Multipurpose files, which makes the MIME type application/x-vensim.
Running update-mime-database ~/.local/share/mime doesn't seem to work.
Ah, I forgot to delete the text/x-vensim type. I fixed that, ran update-mime-database again, associated application/x-vensim with my script in Nautilus, and now double-clicking on a .mdl file in Nautilus opens it in Vensim. I can always right-click on it in Nautilus and select Open With Text Editor if I want to see the model text.
There's still a problem, though: clicking on the link in the PDF file still fails. If both xpdf and evince work the same way, then perhaps the problem is that *nixen expect to have to run a program, so they invoke
, and sh doesn't have a clue what to do with a file of type application/x-vensim.
Does anyone have a clue from this point on?
Lessons to date:
- It's possible to get (at least most of) the effect of file name extensions in Linux, if you need to. (The normal *nix approach involves magic numbers and reading the file contents to figure out file types, but file name extensions do work.)
- Using available tools (e.g., assogiate) can make life easier, for they do know where configuration files belong. In particular, *nixen are really nice in keeping a user's stuff in ~/.
- Reading things like the Gnome manual and the FreeDesktop documentation can help.
Thanks for any advice people may have. I'm a lot closer; I'm just not sure if what's separating me from success is a brick wall or a row of dandelions.
-