![]() |
How to properly use alarmd? (SOLVED)
Hi,
I have been looking for an easy way to access all the alarms set in chinook. osso_worldclock has a nifty little dialog for viewing/adding/editing/deleting alarms that would be perfect to add to my statusbar clock except that I cannot find the source for osso_worldclock anywhere. The alarm statusbar plugin uses the same dialog, but its source is also unavailable. Does anyone know if this dialog can be called using a command or dbus? That would be very helpful. Also, if I try to check what alarms are set in my program using alarmd commands I get a segfault. The following is the code I was using: Code:
#include <alarmd/alarm_event.h> |
Re: How to properly use alarmd?
Quote:
Code:
#include <stdlib.h> |
Re: How to properly use alarmd?
Thank you very much for the reply. I suspect my problem was not compiling with the correct libraries. I will give this another try.
UPDATE: Yes, that was my problem - I wasn't compiling with libalarm CFLAGS and LIBS. Now the program runs with no hitches. So, I can now start the fun task of building an interface similar to that in world clock for managing alarms (since there is no available source for this) |
Re: How to properly use alarmd?
Okay, while my code now compiles and runs with no problems I cannot for the life of me get alarmd running in scratchbox.
alarmd is installed, and when I have af-sb-init running the following occur: - running "/etc/init.d/alarmd start" comes back with "Starting OSSO Alarm Daemon: alarmd." but no process gets started. - running "alarmd -d" executes, but again no process starts. As I only have one tablet I do not relish doing any testing of alarmd on it, especially to the level I eventually want to get. If anyone has been successful in getting alarmd testing to work in scratchbox, please let me know. Thanks |
Re: How to properly use alarmd? (solved)
Just for posterity's sake (in case anyone is searching for how to do this in the future) I will post how to get alarmd to work in scratchbox!
This really is the simplest solution to a frustrating problem I have seen in quite some time. Code:
run-standalone.sh alarmd |
Re: How to properly use alarmd?
#!/usr/bin/env python
#simple example to issue a command using python and maemo alarmed RTC tool # look at /var/cache/alarmd/alarm_queue.ini for the full queue import time,alarm if __name__ == '__main__': event = alarm.Event() event.appid = 'lovelyName' event.alarm_time = time.time() +10 action = event.add_actions(1)[0] action.flags |= alarm.ACTION_WHEN_TRIGGERED | alarm.ACTION_TYPE_EXEC action.command = 'touch /tmp/alarm.txt' cookie = alarm.add_event(event) print cookie |
Re: How to properly use alarmd?
^ Thanks niv, really helped me.
Here's the C++ version: Code:
#include <alarmd/libalarm.h> |
All times are GMT. The time now is 07:04. |
vBulletin® Version 3.8.8