[maemo-developers] [maemo-developers] using execl
From: Brad Burleson bradb667 at gmail.comDate: Fri Dec 16 08:52:53 EET 2005
- Previous message: [maemo-developers] using execl
- Next message: [maemo-developers] using execl
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks to all for the info, and I've actually just started to look at bt-plugin.c. I am sorry for the previous question, I sent it before I was quite finished editing. So, to add on a bit to what I asked - and to get at what I was really asking: It seems to me that most 3rd party applications will want to have a desktop plugin to launch them. In fact, I can imagine people wanting more web links on their desktop than one. So, I'm trying to write a simple generic 'launcher' for a Maemo application. Would I be better off to use D-Bus instead? (is it safe to assume all applications will be a D-BUS service?) Thanks, Brad. PS Tomas - I was looking at bt-plugin.c and was wondering if it would be fairly trivial to add in support for some of the extra keys on the Nokia keyboard? And I suppose sending a signal to keep the screen active is not easy to do? (I'd think if it was you would have added it). On 12/15/05, Tomas Junnonen <tomas.junnonen at nokia.com> wrote: > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20051215/aba474e6/attachment.htm
- Previous message: [maemo-developers] using execl
- Next message: [maemo-developers] using execl
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]