#!/usr/bin/python import dbus import sys bus = dbus.SessionBus() pm_obj = bus.get_object('org.ajalkane.profilematic', '/org/ajalkane/profilematic') pm_intf = dbus.Interface(pm_obj, 'org.ajalkane.profilematic') actions_struct = ['', 0, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, '', '', dbus.Array([], signature=dbus.Signature('(usis)')), '', 0, 1, [dbus.Array([], signature=dbus.Signature('s'))], -1, 0, ['', -1, -1, ''], -1, 0] if len(sys.argv) == 2: seconds = int(sys.argv[1]) else: seconds = 60 title = 'Timer' snooze = 10 sound = '' actions_struct[24] = [title, seconds, snooze, sound] pm_intf.executeAction(actions_struct) print 'Alarm set to go off in %s seconds from now.' %seconds