Release ./pre.sh and ./post.sh support to pnd


Jey123456

Member
Joined
Dec 22, 2009
Messages
228
i edited the pnd_run.sh script to run ./pre.sh and ./post.sh scripts if they are found in the application root (pnd directly or appdata).


./pre.sh is executed before the actual application


./post.sh is executed once the application is gone


Thats a very small change (8 lines), and i know it could cause problem if an app use a script named ./pre.sh or ./post.sh in their root, but i doubt it will be much of an issue.


line 77 and 90 contain the changes.


to install it, backup /usr/pandora/scripts/pnd_run.sh then replace it with this one (or add the 8 lines yourself).

pnd_run.sh.gz
 

Attachments

  • pnd_run.sh.gz
    5.3 KB · Views: 166
Last edited by a moderator:
Why is this necessary? I thought the typical approach for packagers was to have a single script that gets launched by the PND. This script then does whatever pre-stuff, runs the main application, then does whatever post-stuff. I know this is done in Sparks to set the nubs to absolute mode for gameplay, then back to mouse mode afterwards. So is there any particular reason to have multiple autodetected scripts instead of a single explicitly specified one?


EDIT: Ah, I just noticed your other thread, then reread this one. I get it now! It's supposed to be a feature for users, not developers. In that case, I have no real comment. I feel like this is a feature that should get covered by an .ovr file, but I don't know.
 
Last edited by a moderator:
yea, in my case, i find it usefull for the snes emulator and ur-quan master since in both case, as far as i could tell the controls arent exactly user friendly to edit, and both use the keyboard messages. Snes is fine if you use the default settings on the buttons, but i dont, i remapped them to keys i use more often when working in terminal.


so im calling xmodmap in the pre to set the buttons like i need for the game, the reloading my original setting in the post. pretty much the only reason i wanted/needed such support.
 
Jey123456 I quite like this idea, although I am not sure how one sets about doing the key mappings. I have not got time atm to open up the attachment, perhaps it is self evident, otherwise a little guidence for the less informed would be really appreciated (presumably it's a config file somewhere). I've been thinking about re-mapping some of the controls for a few games. BTW what would happen if the emu bombed out, would the post script still fire and set the mappings back to normal?
 
IT'd be managed by the pnd-system so yeah, the post-script would run.


sebt3 is working on an official version of this for HF6


jeff
 
cool, glad it will be in hf6 (tho i assume sebt3 will make a more flexible version, probably based around ovr, but i dont care, so long as it work =D).


As for how i remapped the key, im using xfce as main gui, so xmodmap work for 99% of the apps. just do some research on it, there is plenty of references, as for the keycodes, you can find the regular key ones in just about any docs related to keysim, and for the special pandora buttons, you can find their code by doing some search on this very forum.


There is a default file named ~/.PNDxmodmap on your pandora you can have a look at.
 
Back
Top