How Do I Set Certain File Extensions to Open With Certain Programs?


GeBeCluck23

Member
Joined
May 18, 2013
Messages
131
  Hi, I was wondering how to set certain file extensions to open with particular programs. What I mean by this is when you right-click on a file and you choose "Open With Other Application..." and a list of some installed .pnds comes up, how can you choose which programs to set it to open with, aside from the ones that automatically show up?
 
There has been an addition to the new PXML standard that allows file association, but by default it has to be supported by the developer..  However anything in the PXML can be overridden with ovr files.. I don't have any good tutorials on how to do this right now, but I'm sure someone may be able to chime in.
 
I don't think setting file associations ever made it in to the OVR spec, at least according to the wiki. Only the category, title and cpu speed can be set (and the icon can be overridden by putting the right filename'd PNG file alongside the PND). File associations need to be in the PXML, although it may be possible to tweak the .desktop files directly - there are hints on the wiki.
 
  Okay so, what you're basically saying is, while technically not impossible, it's not nearly worth the effort to make it happen? Well darn, it would've made it a lot more convenient, but oh well, that's life.
 
If there's a particular PND that does not support file associations yet, it makes sense to leave a comment about it on the repo and/or add a post to the forum thread for that PND.

As an individual solution, I guess you could also type something in the "Use a custom command" field.
 
If you've attempted to contact the maintainer and got no response, why not just re-bundle the pnd with a modified pxml.xml (containing the necessary changes)? Then, if the maintainer comes up with the goods, remove your modified pnd and reinstall theirs...
 
  Yeah...but I don't know how to do that... <_< I suppose I could study one of the pxml.xml's that does have file associations to see what I can understand about it, but it would probably be easier for one of you fine gents to go ahead and explain it to me! :)
 
- Go to the repo webpage, sign up for an account so you can make a comment: http://repo.openpandora.org/

- find the application you are using

- post a comment about asking about adding file associations to the PND, it will email the maintainer of a new comment..
 
Last edited by a moderator:
If you've attempted to contact the maintainer and got no response, why not just re-bundle the pnd with a modified pxml.xml (containing the necessary changes)? Then, if the maintainer comes up with the goods, remove your modified pnd and reinstall theirs...
  ...Actually, I was referring to how to do this, the "re-bundling the pnd" part. I already know how to comment on the repo, which I'll probably do when I get the chance. Thanks anyway though for the advice!
 
No idea on Windows, and I don't really know if this will work on the Pandora out of the box (but it probably will), but on a Linux PC you can unpack PNDs using unsquashfs. You can then pack them back up again using squashfs and catting the PXML file and PNG icon onto the resultant squashed image.


If the PND has been packed up as an iso9660 file instead, you'll have to use the corresponding tools for that.


As for tweaking the PXML to make it available for file associations, I refer you to the wiki


Hmm, actually there's more including how to do the unpacking and repacking in Windows also on the wiki (though at time of writing, they could be clearer).
 
If you've attempted to contact the maintainer and got no response, why not just re-bundle the pnd with a modified pxml.xml (containing the necessary changes)? Then, if the maintainer comes up with the goods, remove your modified pnd and reinstall theirs...
  ...Actually, I was referring to how to do this, the "re-bundling the pnd" part. I already know how to comment on the repo, which I'll probably do when I get the chance. Thanks anyway though for the advice!
I use the following general method:

First, mount the pnd - that way, you can easily clone the entire pnd contents by accessing a sub directory in /mnt/utmp. From a shell prompt, issue the following general mount command:

/usr/pandora/scripts/pnd_run.sh -p <FULLY QUALIFIED PATH TO PND INCLUDING PND NAME> -b <MOUNT NAME IN UTMP> -m

You can use whatever <MOUNT NAME> you like - just make sure a directory with <MOUNT NAME> is not already in /mnt/utmp, otherwise things will get messy. Do not include the <> braces in your commands!

Next, using your normal file manager, copy the entire contents of /mnt/umtp/<MOUNT NAME> into a temporary sub directory of your choosing.

Now, issue an unmount command, which is essentially the same as the mount command, but replacing -m with -u

It is important you ensure you unmount the pnd before you forget - otherwise things will get messy when you try and run the pnd. If you do this often, you will forget at least once!

Now, navigate to the temporary directory that contains the cloned contents of the original pnd. Edit the pxml.xml file, adding the appropriate file extension information. Whilst you are here, find the physical location of the icon file for the pnd - you'll find its path in the pxml.xml file under <icon src>.

Now, to rebuild the pnd, use the following general command:

/usr/pandora/scripts/pnd_make.sh -c -d <FULLY QUALIFIED PATH TO THE PND CONTENTS WITHOUT FINAL SLASH> -i <FULLY QUALIFIED PATH TO ICON FILE INCLUDING ICON FILE NAME AND EXTENSION> -p <FULLY QUALIFIED PATH FOR NEW PND INCLUDING PND NAME WITH PND FILE EXTENSION>

This is only a brief, general explanation of the process I use to 'adjust' pnd files built by others for my own purposes. There are other methods; this is not necessarily the definitive route but it is as good a starting pace as any. There are a few gotcha's that could crop up along the way, for example, the pxml.xml file may contain multiple application entries. Do you know what you need to do to add the file extension association?
 
  No, I don't know how to do that... what you ALREADY told me kinda blows my mind, I'll try doing what you said when I get the chance.
 
  No, I don't know how to do that... what you ALREADY told me kinda blows my mind, I'll try doing what you said when I get the chance.
OK, perhaps an example would help. Here's an example using a fictitious pnd called foobar.pnd, stored in /media/code/Pandora/Menu:

Mount:

/usr/pandora/scripts/pnd_run.sh -p /media/code/Pandora/Menu/foobar.pnd -b foobar -m

Unmount:

/usr/pandora/scripts/pnd_run.sh -p /media/code/Pandora/Menu/foobar.pnd -b foobar -u

Now, lets assume that after issuing the mount command, you copied the contents of the pnd into /media/code/tmp, and that /media/code/tmp only contained the copied contents of the pnd. In other words, everything in /media/code/tmp belongs in the pnd. Also, lets assume that <icon src> in pxml.xml told us the icon was at images/icon.png (so, you should actually find it in /media/code/tmp/images). Finally, lets assume that we will temporarily store the rebuilt pnd in the root of /media/code until we decide what to do with it. Then, to re build the pnd you would use:

/usr/pandora/scripts/pnd_make.sh -c -d /media/code/tmp -i /media/code/tmp/images/icon.png -p /media/code/foobar.pnd

Of all these paths, the one that requires the greatest care is the path to the icon, since it is an expanded version of that listed in pxml.xml. The icon path in pxml.xml can be thought of as being relative to the directory containing the contents of the pnd (if that makes any sense)!

You can try all of these steps yourself non destructively - you wont break anything other than the pnd you are attempting to rebuild. So, if it doesn't work, you can just throw it away and try again!
 
  No, I don't know how to do that... what you ALREADY told me kinda blows my mind, I'll try doing what you said when I get the chance.
OK, perhaps an example would help. Here's an example using a fictitious pnd called foobar.pnd, stored in /media/code/Pandora/Menu:

Mount:

/usr/pandora/scripts/pnd_run.sh -p /media/code/Pandora/Menu/foobar.pnd -b foobar -m

Unmount:

/usr/pandora/scripts/pnd_run.sh -p /media/code/Pandora/Menu/foobar.pnd -b foobar -u

Now, lets assume that after issuing the mount command, you copied the contents of the pnd into /media/code/tmp, and that /media/code/tmp only contained the copied contents of the pnd. In other words, everything in /media/code/tmp belongs in the pnd. Also, lets assume that <icon src> in pxml.xml told us the icon was at images/icon.png (so, you should actually find it in /media/code/tmp/images). Finally, lets assume that we will temporarily store the rebuilt pnd in the root of /media/code until we decide what to do with it. Then, to re build the pnd you would use:

/usr/pandora/scripts/pnd_make.sh -c -d /media/code/tmp -i /media/code/tmp/images/icon.png -p /media/code/foobar.pnd

Of all these paths, the one that requires the greatest care is the path to the icon, since it is an expanded version of that listed in pxml.xml. The icon path in pxml.xml can be thought of as being relative to the directory containing the contents of the pnd (if that makes any sense)!

You can try all of these steps yourself non destructively - you wont break anything other than the pnd you are attempting to rebuild. So, if it doesn't work, you can just throw it away and try again!
  Thank you very much, this makes a lot more sense now! I still don't have time to try it yet, this past week and a half has been SUPER busy, but in the meantime, the only thing I don't understand about it, is once I mount the .pnd, how do I copy the contents to "tmp"? Or whatever I decide to name it.

  What I mean is, when I mount it, where will the files be mounted for me to copy them over? Or do I have to use the command line to access the mounted files? Just...what do I do?
 
The mounted files will be stored under the mount point you specified to the pnd_run command, under /mnt/utmp ('/mnt/utmp/foobar' in MarkW's example, under whatever current directory you're in in the terminal).  They'll disappear again when you run pnd_run with -u to unmount it, so you need to copy them somewhere else to keep hold of them.

Personally I'd use the command line to do this, since you're already in the command line doing the pnd_run magic.


cp -r /mnt/utmp/foobar /media/mysdcard/pndstuff
should do it (assuming your SD card is labelled 'mysdcard').

Alternatively, the built-in file manager (Thunar) can do it too.  Navigate to /mnt/utmp select, copy and paste anywhere you want on your SD card.
 
Back
Top