Executing PNDs via doubleclick?


Emnasut

Member
Joined
Apr 26, 2010
Messages
357
When I doubleclick a pnd in Thunar nothing happens, same thing with right click->execute. It does work by selecting "run with other app" and choosing pndrun. Isn't it possible to immediately execute the pnd via doubleclicking?
 
I tried that, but double clicking still doesn't do anything even though I can choose to use "pnd quick run" from the application list.
 
File associating pnd to pnd_run should do it.


The only trick would be if the app you want is not the first one in the pnd and its a multi-app pnd; in that case, pnd_run needs to be told which sub-app. In minimenu, it'll show "app#3" (or whatever) in the detail panel for an app, so you can tell what subapp number an app is within its pnd.


jeff
 
File associating pnd to pnd_run should do it.


The only trick would be if the app you want is not the first one in the pnd and its a multi-app pnd; in that case, pnd_run needs to be told which sub-app. In minimenu, it'll show "app#3" (or whatever) in the detail panel for an app, so you can tell what subapp number an app is within its pnd.


jeff

Where can I associate the pnd if not in the rightclick menu?
 
Does doubleclicking (or rightclick->execute) in Thunar run a pnd for anyone here? I just can't get it to work...


Where is the association from rightclick->"Open With"->"Open With Other Application..." stored? I thought it was in /usr/share/applications/mime.cache but deleting the line in there and then trying to reassociate pnd_run to a pnd via rightclick didn't insert a new line in there...


It seems like the "Use as default for this kind of file" doesn't do anything, if I choose pnd_run the pnd starts but if I later either doubleclick, rightclic->execute, or select it and press Enter nothing happens at all, not even the LED on the left flashes as it normally does when accessing the SD card. Also I can't seem to change the default icon for pnds (the gears or whatever that is) to something else, the option is simply not there when I right-click any pnd...
 
Are you trying to run them directly in addition to the default way because you want to, or is it because you aren't aware of the proper place to put them so they appear on the menu? I need to estimate how much effort I'm about to spend if I help you get this working. :p
 
Heh, it is because I want to. :)


I know - and use - the default way, it's just that for one thing it just bothers me that I can't get it to work and for another, when I just copied stuff over from my mounted pc I want to run it immediately without using the menu...


I guess I just can't stand something not working as it should (or as I *think* it should) and as the Pandora is open and Linux allows to change everything I don't want to just cope with stupid stuff like I have to in Windows and about every mobile in existence. :)
 
Ok, I got it :)


The problem is that Thunar thinks that PND is just a raw executable type: by default, it tries to execute it, as if you had just typed "./somegame.pnd" on the command line. It does this because any file with the execute bit set and no mime type is assumed to be executable. Makes sense in the linux world: if we don't know what it is, but the user says it's an executable, who are we to argue? Except the execute bit is always set in FAT32, so every file the OS does not explicitly know what it is, it is going to try to run as an application.


Solution: tell the OS what a pnd is. There's supposed to be an easy and automatic way (update-mime-database) to do this, but there seems to be some files missing from the Pandora that let you do so, so we will have to do it manually for now, until someone tells me what I'm doing wrong.


As super user (sudo) edit the file "/usr/share/mime/globs" and add to the very bottom "application/pnd:*.pnd", and the file "/usr/share/mime/globs2" gets "50:/application/pnd:*.pnd"


Not sure why globs2 gets a "50:" but it's needed to make it work. Other numbers might also work, but since I have no idea what it's for I'm not going to mess with it.


Reboot!


Now *.pnd files are no longer identified as generic applications that it will try to run if you double click them. Now they are documents of type application/pnd, which you can associate a program to open them with, exactly as you have done already.


I think I'll suggest this fix, as well as making the default "run with" for pnd files, into Hot fix 6.


edit: For super easy use, globs and globs2 pre-edited for you. Just copy those into the /usr/share/mime directory, overwriting the existing files.
 
Last edited by a moderator:
Wow, thanks a lot, I edited the files and it works like a charm! And also thank you for the great explanation (and for taking your time figuring this out just because it bothered me ^^)! :)


And good idea to get this into HF6, maybe with a nice icon like the Pandora-smiley some use in their postings? Strange thought that you still can't change the default icon in properties, I would have guessed that icon was tied to being executable and after the changes I should be able to just change it...


Edit: Oh I see you even provided files for downloading, this is really a great community! :)
 
Another possibility is to make PND's actually executable, which we can do with the kernel-module binfmt_misc(assuming it's installed, I dont' have my pandora yet..):


You first might have to mount binfmt_misc:


mount -t binfmt_misc none /proc/sys/fs/binfmt_misc


then you can register pnd's like this (assuming that's where pnd_run lives, must be the full path):


sysctl -w fs.binfmt_misc.register=:pND:E::pnd::/usr/bin/pnd_run:


binfmt_misc's arguments are of the form :name:type(M for magic, E for extension):eek:ffset:magic/extension:mask:interpreter(full path):flags


read this for more info.


This doesn't survive a reboot, so put it somewhere in the boot-scripts.
 
Last edited by a moderator:
mmm, in theory pnd_utils should had built the mime type for pnd and updated it. tho that part seemed a bit buggy, its hard to test since once the mime is here, it doesnt seem to go away even if you remove it and reupdate ><. next time i reflash mydevice, ill try it out and see what i can do to fix it.
 
Another possibility is to make PND's actually executable, which we can do with the kernel-module binfmt_misc(assuming it's installed, I dont' have my pandora yet..):


(...)

Interesting, that sounds a lot more complicated though, is there a benefit in doing it that way instead of the other?


Also, still no luck with assigning another default icon to pnd files, is there alse some file I have to edit that links to an icon or something like that?
 
Last edited by a moderator:
It looks like XFCE just uses icons based strictly on the mime type and the selected theme, no way to personalize them or anything simple. Could be wrong about that though.


Now that pnd files have their own mimetype, you should be able to modify the theme, at least. Can't figure out how to do that, unfortunately, but I hope I'm pointing you in the right direction.
 
on my pandora, there is custom icons on the pnd (tho its not "their" custom icon, its just a little pandora icon i added).


once i figure how i made it work (i tougth i know, but since pnd_utils dont seem to do it, then i guess i was wrong, must be something else i did on my pandy ><), ill update pnd_utils so that it work for it xD.
 
on my pandora, there is custom icons on the pnd (tho its not "their" custom icon, its just a little pandora icon i added).


once i figure how i made it work (i tougth i know, but since pnd_utils dont seem to do it, then i guess i was wrong, must be something else i did on my pandy ><), ill update pnd_utils so that it work for it xD.

That would be great, thanks! :)
 
ok... thats annoying ><, just reflashed my pandora so i could try it out. indeed it didnt work directly with the pnd, but running the ./runme from a terminal instead (after mounting the pnd), did work ><.


i need to figure whats different between launching it from launcher and from the terminal ><. most likely, some xdg environment variables arent being set correctly.
 
Huh, I didn't even know you could manually mount a pnd and then run stuff in it from the terminal...
 
Back
Top