ext Brad Burleson wrote:
I'm probably doing something stupid, but I'm trying to write a home plug-in that executes a shell script (which, in turn, will eventually launch some application). I hacked the code from one of the nokia 'hello-world-app' programs and except for struggling with the gnu build tools (and my own ignorance) things are going well. My code looks like this: execl("/bin/sh", "sh", "-c", "pplay", (char *)0); When I do this within a callback, as soon as the button is clicked the screen turns white and the script - and application - runs, but the UI is broken - hard to explain, but it's not drawn completely and the only function that seems to work is to close the program. At which point, the 770 reboots. (my feeble mind says it must be related to the [l]eave part of execl()) Any tips on how to execute a shell script (or any binary) from a maemo application?

The home plugins do not have their own main loop but use the desktop's, so when you call execl the desktop process image is in fact replaced with that of the called program.

As pete said, you should use the g_spawn_* functions instead. In practice you should only ever be using the async versions in the home plugins and statusbar applets, as they will not block updating of the desktop while your child process runs. If you need an example of using g_spawn_async, take a look at the btkeyboards plugin at http://770.fs-security.com/keyboards.html.

Regards,
Tomas
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers

Reply via email to