Manage multiple "same" PNDs with different appdata


PowerGod

Forum Addict!
Joined
Jun 20, 2011
Messages
4,421
I always deal with the fact that just only one PND is seen/used even if many (same PND) are present in different locations, but sometimes I had the need to keep separate the appdata of one of them to use it in a different way, and everytime that I have the need to change from one to another I have to move away the PND I don't want to use...

I can make an example of a very messed situation I'm in:

I'm using OpenBOR, that can manage in it's appdata different games in "pak" format... BUT sometimes there are games for it that needs to use even some other modded files to be kept in the root directory of the program, and not just as a pak... the bad thing is that when this custom files are used, every other games works in the wrong way...

(Same story for the SORR Mods)

So in this case there's the need to manage different OpenBOR appdatas, and I had to put the PND in different SD so I can use it with the game I want... but sometimes I have other things in the SD that I may need, and when happen the situation when I have the program on BOTH of them I always have to move away one of the PNDs as always...

Isn't there a way to add some kind of PND specification to make possibile identify them as always (for updating purpose) but differentiate/duplicate them in the menu ?

Maybe a cfg file in the appdata directory containing:

alt_menu_title="OpenBOR - Streets of Rage wathever"
So when you select it, will be used that PND/appdata instead of the first found... 
Can this be made without destroying the actual system ?
 
Last edited by a moderator:
The appdata folder is specified on the pnd_run.sh command line with the -b parameter,  so all you need to do is create a custom launcher for the PND you want to use with a different appdata folder  and launch it with a different -b parameter.

(or just launch it that way from the command line)

You can check the .desktop file for the application for its default  command line.  For example on my pandora the .desktop file to launch DraStic contains the following line:

Code:
Exec=/usr/bin/nohup /usr/pandora/scripts/pnd_run.sh -p "/media/PND-DATA/pandora/apps//drastic.pnd" -e "drastic.sh" -b "DraStic"

So if you create a custom launcher that executes the command

Code:
/usr/bin/nohup /usr/pandora/scripts/pnd_run.sh -p "/media/PND-DATA/pandora/apps//drastic.pnd" -e "drastic.sh" -b "DraStic2"

It will mount to /mnt/utmp/DraStic2 and use the appdata/DraStic2 as the appdata folder, when launched with that launcher.

- Neelix
 
Your method works if you have all the data in the same support of the first pnd found, not if the alternate data is on another one, anyway it can have problems if an app script starts mapping the HOME dir specifically in the default appname directory (like OpenBOR do)...

Anyway I duplicated a .desktop file and modified in it every path and is working !!

BUT the bad news is, if I reinsert the SD, the .desktop file is automatically deleted...
 
That's why I suggested creating a custom launcher.  If you right click on the desktop and click  Create Launcher (or right click the panel, select Add New Items then select Launcher)  It will create a shortcut which will persist even once you eject the card.

Also this is exactly why it is a bad idea to explicitly refer to the PND mount folder with an absolute path within a PND.   pnd_run.sh sets $HOME is to the mount folder by default anyway.

- Neelix
 
Oh, didn't know about the laucher creator thing, I was thinking you were speaking about doing an sh script

Seems like a normal .desktop file just without references to the PND ID

Anyway should be useful to have this kind of things somewhat automated... so to have the those icons disappear when the interested support isn't inserted
 
I can think of one way of automating it... it's kind of convoluted though...

1. Create a new folder visible to libpnd  (ie create a new folder within (for example) pandora/apps/)

2. Create a script to in that folder to launch your PND with the modified appdata line

3. Create a PXML file in that same folder that describes the launcher (as an application) and executes your script from step 2. - this will make libPND treat the folder as if it were a PND, so it will create/remove the launcher automatically.

- Neelix
 
If you need a hand to do something just tell me, anyway I will have to study a bit how libpnd works... I don't even know what is launched when a support is automounted...
 
Last edited by a moderator:
At this point I have no interest in implementing such a thing except as a theoretical exercise. :)   If I had a reason to do this I would just stick with the custom launcher method I mentioned originally.

I don't know what you mean by "when a support is automounted."  Could you please rephrase that?

- Neelix
 
when you insert an SD or an USB stick them are automatically mounted and then some script is launched to find PNDs... I will give a look at how it works...

Maybe I will be able to create something working following your steps...

Anyway let me know if you do that "theoretical exercise" :D

I'm not in a hurry, and I have other things I'm working on, but this seems like a lack to me
 
Back
Top