The Following User Says Thank You to thp For This Useful Post: | ||
|
2012-06-13
, 17:13
|
Posts: 55 |
Thanked: 28 times |
Joined on Jan 2010
|
#92
|
Which version of Billboard are you using? How many lines of text do you want to display? There's a hard limit of possible lines in order to avoid screen burn in.
Yes, the script is invoked with a 1000ms time limit in order to avoid "hangs" by badly coded scripts. Output is captured from stdout.
Caching the data is actually a good idea, and you should do that in general (e.g. also in cases where there is no internet connection). Also saves battery power.
|
2012-06-13
, 18:07
|
Posts: 277 |
Thanked: 319 times |
Joined on Jan 2010
|
#93
|
Thanks. I found that on my particular installation, I have many enabled alarms in "TRANQUIL" state (they don't show up in the UI), and active alarms that I set are in the state "QUEUED", so I query for that specifically (one might also have to query for a specific APPLICATION attribute to filter out calendar reminders, but for me this works at the moment):
Code:#!/usr/bin/python # List upcoming alarms on MeeGo 1.2 Harmattan # Thanks to slarti on TMO for figuring out the D-Bus methods # Thomas Perl <thp.io/about>; 2012-06-13 import dbus bus = dbus.SystemBus() time_obj = bus.get_object('com.nokia.time', '/com/nokia/time') time_intf = dbus.Interface(time_obj, 'com.nokia.time') cookies = time_intf.get_cookies_by_attributes({'enabled': '1'}) def get_queued_alarms(): for cookie in cookies: attributes = time_intf.query_attributes(cookie) if attributes['STATE'] == 'QUEUED': yield ' '.join((attributes['alarmtime'], attributes['TITLE'])) print '\n'.join(sorted(get_queued_alarms())) or 'No alarms'
python ./enabledalarms.py
Traceback (most recent call last): File "./enabledalarms.py", line 6, in <module> import dbus ImportError: No module named dbus
{script:/home/user/enabledalarms.py}
06:30 later 09:00 earlier
1=mon,2=tue,3=wed,4=thu,5=fri,6=sat and 0=sun
|
2012-06-14
, 12:01
|
Posts: 648 |
Thanked: 650 times |
Joined on Oct 2011
|
#94
|
|
2012-06-14
, 12:56
|
Posts: 277 |
Thanked: 319 times |
Joined on Jan 2010
|
#95
|
print "hello world"
|
2012-06-14
, 14:25
|
Posts: 55 |
Thanked: 28 times |
Joined on Jan 2010
|
#96
|
|
2012-06-14
, 14:38
|
Posts: 277 |
Thanked: 319 times |
Joined on Jan 2010
|
#97
|
|
2012-06-14
, 15:19
|
Posts: 55 |
Thanked: 28 times |
Joined on Jan 2010
|
#98
|
That's just it. enabledalarms.py works perfectly from the command line. Only in Billboard it doesn't.
Can you get the script posted by thp to work in Billboard?
|
2012-06-14
, 15:50
|
Posts: 55 |
Thanked: 28 times |
Joined on Jan 2010
|
#99
|
The Following User Says Thank You to achilles333 For This Useful Post: | ||
|
2012-06-14
, 22:47
|
Posts: 90 |
Thanked: 35 times |
Joined on Jan 2012
|
#100
|
Last edited by thp; 2012-12-21 at 09:35.