pnd custom script ?


Jey123456

Member
Joined
Dec 22, 2009
Messages
228
I was wondering if there is currently a standard way to run a start/end script that is user defined outside of the pnd.


For instance, if i wanted to remap my controls when starting the snes emulator, then undo the maping when it close, i was thinking adding some script in the pnd launching code to check in the appdata folder for a ./start and ./end and run them accordingly, which would pretty much allow for any custom scripts to be added to any pnd without having to edit the pnd itself.


I believe there is currently a way to set custom speed etc, but i cant seem to find much info on how to do that outside of minimenu.
 
well, i found the doc on the .ovr, but it doesnt really help for what i was thinking. so i guess ill go ahead and make it happen xD.
 
Last edited by a moderator:
I've done similar for a few things. Extract the start script from the PND, edit it how you want, and put it in the back into the appropriate appdata directory. It'll run your custom start script rather than the one in the PND.
 
yea, i know that method, but its annoying if the pnd script changed in an update. ill edit the pndrun to do what i want tonight. thanks
 
Last edited by a moderator:
Unless the start script being called in the PND changes, updating the PND shouldn't cause a problem.


Your method would be very useful though, I think it should be considered for implementation in the official firmware, once it's ironed out a bit.
 
well, once i have it done, ill post it in the beta testing, shouldnt be anything complicated anyway.
 
hmm, a few ways to do it come ot mind ..


Given /path/to/foo.pnd, could have pnd_run.sh check for $PATH.pre and $PATH.post say .. ie: /path/to/foo.pre and /path/to/foo.post


Or could specify somethign in an ovr ..


[script]


pre-run<tab>//path/to/script/pre.sh


post-run<tab>/path/to/script/post.sh


(the ovr approach letting you have one script re-used by many pnds, for instance.) The ovr approach would depend on pnd-run.sh being greppy on ovr's (sort of lame), but no real alternative; another option would be to extend libpnd slightly so it could emit it to the .desktop (and mmenu could handle it directly.) But the least disruptive approach I think would be the .pre and .post files, and have pnd_run.sh check and run them.


jeff
 
i went with the easy/lazy way, it work fine. but as i said in the beta post, it is possible (while unlikely) to conflict with some pnd.
 
Back
Top