![]() |
Hooks available for running programs on events?
I got my N900 two days ago, and after playing around with some stuff I would like to start programming some things myself. I'm still working on getting Scratchbox fully setup on my Debian box, but in the meantime I was wondering how some of the interfaces work. I've had a look around the repos, but I have some difficulty finding the right documentation.
Where would I find the docs on running a certain script/program on certain events? For my first program (after some hello worlds) I would like to make the phone vibrate the name of the sender of a text in morse on receiving a SMS. I'd simply add a pattern for every letter in mce.ini and call those via DBUS. However, I can't find a way to run a program on receiving a text that does the right thing. Of course I could hack the rtcomm event logger, which has all the proper data, but that wouldn't be very neat (or packable). Any ideas? |
Re: Hooks available for running programs on events?
Well, you can create a deamon for that, I'm not sure how to do it but it can start automatically on startup, run all the time in the bg and listen to the desired dbus.
If you want it to be controllable, you can make it an application or a desktop app or even a status-menu app. The first one will run on demand, the second might run automatically on startup if added to the desktop, and the third one will run on startup. |
Re: Hooks available for running programs on events?
Where would I find the correct dbus hook? I couldn't find anything in the docs about which one to listen for. Setting up a daemon and such would be in more general Linux docs, probably. I could find that out once I know what to listen for...
|
Re: Hooks available for running programs on events?
Quote:
You can find more about DBUS in general here: http://wiki.maemo.org/Documentation/...us/DBus_Basics regarding finding the dbus to use, here is what I do: First, I use "dbus-monitor --session" or "dbus-monitor --system", depends on what channel you need (I believe SMS is session). I pipeline it to a file (so it will be more convenient) and reproduce the state I'd like to catch it's dbus channel (for incoming SMS, for example, I send myself an SMS from Skype or gmail). Then the pipelined file contains ALL dbus method and signal calls. Method call are for invokation (do something), and signals are to listen to something. The output contains all the necessary information about the dbus (name, path, interface and type). Hopes this helps. |
Re: Hooks available for running programs on events?
There are dbus-scripts and dbus-scripts-settings packages, exactly for this. See here: http://talk.maemo.org/showthread.php?t=48132
|
Re: Hooks available for running programs on events?
dbus-scripts sounds very promising. I'll log all the stuff to a file and see if I can get some texts. However, logging and intercepting seems rather roundabout for something that should just be documented. Isn't there any API documentation for the dbus signals sent by various packages?
|
All times are GMT. The time now is 12:02. |
vBulletin® Version 3.8.8