View Single Post
Posts: 235 | Thanked: 339 times | Joined on Nov 2010
#149
I like these ideas

Originally Posted by sjgadsby View Post
1. If the alarm D-bus signals allow it, I'd like a small, non-GUI application that registers itself to be called anytime the alarm goes off. Once called, the application would for a short time monitor the accelerometer for, say, a triple tap on the device. If the triple tap came, the application would dismiss the alarm. Otherwise, the app would simply close itself.
When doing quick, cursory looks into how the alarm stuff works on the N800 for auouymous' advanced system-ui, I found that there are no D-Bus signals emitted (on the N800 at least).

However, there's a sort of abstraction between alarmd and the alarm dialog itself, the latter is provided by SystemUI.

alarmd commands the alarm dialog to present itself through a D-Bus method call; see its methods here. As alarmd is open-source, one could modify it either to run a program of your choosing or to make it emit a signal before it shows the dialog.

There's one problem, though, that may be evident if you look at the methods provided: The alarm_close method doesn't allow for the response to be given (snooze etc.) so I'm not sure how useful it would be for your use case of appointments. As the alarm dialog itself is closed-source, modification is not realistically possible either.

2. I'd like a addition to the status menu with several buttons, a bit like the Simple Brightness Applet. However, instead of various brightness levels, the buttons on this new applet would be for different units of time, perhaps 1/2 hr, 1 hr, 1-1/2 hrs, 2 hrs, and 2-1/2 hrs. Tapping one of the times would immediately switch the phone from General profile to Silent profile and register an event with alarmd the selected amount of time in the future. The alarmd event, when it arrived, would prompt the applet to switch back to the General profile.

This would allow the phone to autimatically return to it's normal, useful, noisy self after being curtious during events such as meetings, movies, and dates.
I'm certainly no programmer, but this is easy for anyone with basic GTK+ knowledge. Hell, I'd do it but I removed my Ubuntu install and Python's not for me.
In essence (take note of the "no programmer" bit!), all that would be required would be to:
  • Pack a bunch of GtkToggleButtons
  • Handle their "clicked" events by setting the profile to Silent and creating a timer etc.
  • Setting the profile back when done and deselecting the button, having stopped the emission of the clicked signal first

(AFAIK there's no support for Qt applets in the status menu area)

Manipulation of profiles is easy, just use http://maemo.org/api_refs/5.0/5.0-final/libprofile/ or profiled's D-Bus interface directly.
In my opinion, using alarmd is overkill for such a simple task with not such long times, but perhaps alarmd has battery benefits I'm not aware of (and the RSS application uses it as far as I know)? An alternative would be the simple timeout but using the IPHB functionality (used by those news and Amazon applets if I remember correctly) of the N900 which tries to emit any "wake up" events to all using it at around the same time, given you can live with it being a few seconds early or late

Last edited by jstokes; 2011-01-22 at 11:58.
 

The Following User Says Thank You to jstokes For This Useful Post: