|
|
2012-06-16
, 07:25
|
|
Moderator |
Posts: 6,215 |
Thanked: 6,402 times |
Joined on Nov 2011
|
#102
|
|
|
2012-06-17
, 16:16
|
|
Posts: 116 |
Thanked: 39 times |
Joined on Jun 2010
@ Finland
|
#103
|
|
|
2012-06-19
, 00:21
|
|
Posts: 90 |
Thanked: 35 times |
Joined on Jan 2012
|
#104
|
|
|
2012-06-19
, 09:46
|
|
|
Posts: 1,390 |
Thanked: 4,262 times |
Joined on Sep 2007
@ Vienna, Austria
|
#105
|
I had a quick play around but I haven't figured out a functional way to enable/disable billboard from the command line. Anyone tested this yet?
This way anyone really concerned about battery life could enable/disable using Profilematic overnight
gconftool -t bool -s /apps/billboard/enabled true
gconftool -t bool -s /apps/billboard/enabled false
|
|
2012-06-19
, 12:25
|
|
Posts: 90 |
Thanked: 35 times |
Joined on Jan 2012
|
#106
|
|
|
2012-06-19
, 13:49
|
|
Posts: 277 |
Thanked: 319 times |
Joined on Jan 2010
|
#107
|

#!/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
# Horribly mangled by slarti to find only the next alarm
# (set from clock application); 2012-06-19
import dbus
from datetime import datetime, timedelta
import time
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'})
today = datetime.now()
tomorrow = today + timedelta(days=1)
def list_queued_alarms():
for cookie in cookies:
attributes = time_intf.query_attributes(cookie)
alarmtime = attributes['alarmtime']
if attributes['STATE'] == 'QUEUED':
if 'recurrence' in attributes:
days = tuple(attributes['recurrence'])
else:
if datetime.time(datetime.strptime(alarmtime, ("%H:%M"))) > datetime.time(datetime.now()):
days = time.strftime("%w")
else:
days = tomorrow.strftime("%w")
weekdays = dict([(day, time.strptime((day + " " + alarmtime),'%w %H:%M' )) for day in days])
for day in days:
yield ' '.join((day,time.strftime('%a %H:%M',weekdays[day]),attributes['TITLE']))
findme_list = [' '.join((time.strftime('%w %a %H:%M'),'findme'))]
L = list(list_queued_alarms()) + findme_list
L.sort()
findme_string = ' '.join((time.strftime('%w %a %H:%M'),'findme'))
findme_int = L.index(findme_string)
if len(L) == 1:
next_alarm = 'xxNo alarms'
else:
if findme_int == (len(L) - 1):
next_alarm = L[0]
else:
next_alarm = L[findme_int + 1]
print next_alarm[2:].encode('utf-8')
import time
print ' '.join(['Week',time.strftime("%W")])
| The Following 3 Users Say Thank You to slarti For This Useful Post: | ||
|
|
2012-06-19
, 15:10
|
|
Posts: 133 |
Thanked: 108 times |
Joined on Mar 2012
|
#108
|
|
|
2012-06-19
, 17:41
|
|
Posts: 90 |
Thanked: 35 times |
Joined on Jan 2012
|
#109
|
If you are using Profilematic, why not just disable stand-by screen when you are sleeping and restore back when you are not.
|
|
2012-06-20
, 02:30
|
|
Posts: 277 |
Thanked: 235 times |
Joined on Jan 2012
|
#110
|
So, it seems that Billboard can't show scandinavian letters.
edit: It doesn't show scandinavian letters from scripts. They show up just fine if I write them directly to the input field in Billboard. Should the output from the script be encoded somehow?
Last edited by slarti; 2012-06-16 at 07:10.