View Single Post
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1028
Want your phone to do something when an alarm with a certain name goes off? Use this:

The basic idea is to set a special profilematic 'alarm rule' which executes its actions when an alarm with a certain title goes off. The rule gets deactivated when the next active alarm is not one with the set title or there are no alarms. The alarm title is set in the script as the passwd variable. By default, it's Test.

When the script is running, it will create an 'empty' alarm rule once you set or unset any alarm in the clock application. You can modify the rule freely in profilematic, but don't change the name (probably a good idea to not have another rule with the same name). The time and day will be set by the alarm. This rule is basically meant for 'one-shot' actions so design the actions with that in mind.

If you want to try it out, you'll need to apt-get install python python-dbus python-gobject (as root). Start the script and leave it running in terminal. Try setting and unsetting various alarms and see what happens in profilematic.

To make it run on startup, add it to the default rule as custom action.

The script can be found here.

I've tested this for months without any problems or battery drain.

Added some screenshots to maybe make this a little clearer.


Last edited by slarti; 2013-12-04 at 19:57. Reason: Updated for PM 2.4.2
 

The Following 2 Users Say Thank You to slarti For This Useful Post: