Notices


Reply
Thread Tools
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#101
Originally Posted by achilles333 View Post
You can send me your script to me. I will check on mine.

My guess is if it is working from command line then the issue is the billboard app isn't capturing the output. Billboard app is capturing output only if the script completes within 1000ms and looks like your script is taking more than 1 sec(1000ms).
Thanks for trying it out, but that wasn't it. I ran the script with:
Code:
time python enabledalarms.py
and got:
Code:
06:20 Herätys
real     0m 0.36s
user     0m 0.17s
sys      0m 0.02s
BUT, when I changed the title of my alarm "Herätys" to "Heratys" it magically showed up in Billboard, too!

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.
 
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#102
thp could you help me...
i wanted to create a .py script to show the upload and download speed on the standby screen when using wifi hotspot but don't have much knowledge...
 
Posts: 116 | Thanked: 39 times | Joined on Jun 2010 @ Finland
#103
This app is brilliant! =)

Hopefully author will update it with new features
 
Posts: 90 | Thanked: 35 times | Joined on Jan 2012
#104
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
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#105
Originally Posted by WhitP View Post
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
To enable:
Code:
gconftool -t bool -s /apps/billboard/enabled true
To disable:
Code:
gconftool -t bool -s /apps/billboard/enabled false
 

The Following 2 Users Say Thank You to thp For This Useful Post:
Posts: 90 | Thanked: 35 times | Joined on Jan 2012
#106
Works like a charm with Profilematic.
May as well leave it in place as I don't need Billboard when I'm asleep!
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#107
EDIT 7:

Disregard everything below and use customizable_alarm_lister.py instead.

EDIT 6:

One probably has to install python and python-dbus (apt-get install python python-dbus) to use this.

EDIT 3: Works as it should now. Finds even 'No alarms'

After a lot of trial and error, I managed to write this horrible mess based on thp's script to find out the next enabled alarm. It's ugly but it works:

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
# 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')
I got excited about python, so I made a "script" to show the week number, too.

Code:
import time

print ' '.join(['Week',time.strftime("%W")])
Edit 4:

Add .encode('latin1') to the last line in the text file to show for example letters öäå.

Has to do with this: http://talk.maemo.org/showpost.php?p...&postcount=293

Edit 5:

Change back to UTF-8 once Billboard 1.0.7 is out.
Attached Files
File Type: txt enabledalarms.py.txt (1.8 KB, 184 views)

Last edited by slarti; 2013-10-28 at 13:39. Reason: added requirements
 

The Following 3 Users Say Thank You to slarti For This Useful Post:
Posts: 133 | Thanked: 108 times | Joined on Mar 2012
#108
Originally Posted by WhitP View Post
Works like a charm with Profilematic.
May as well leave it in place as I don't need Billboard when I'm asleep!
If you are using Profilematic, why not just disable stand-by screen when you are sleeping and restore back when you are not.
 
Posts: 90 | Thanked: 35 times | Joined on Jan 2012
#109
Originally Posted by bnwg View Post
If you are using Profilematic, why not just disable stand-by screen when you are sleeping and restore back when you are not.
It's in a case overnight so there's no point as the screen is off already - however the background process takes a small amount of power (and it's only about 1mA) whether the screen is on or not..

Compared to my podcasting habit it's a miniscule power drain but as it's set up and working anyway I'll keep it
 
Posts: 277 | Thanked: 235 times | Joined on Jan 2012
#110
@THP

I posted this in another thread, but seeing that you are prevalent with the features of the standby screen I was wondering if there could be a spectrum analyzer option with turn on/turn off when you go to lock screen, color, and different types of anayzers for listening to music. I don't really care about power consumption I just think it would be a neat feature to have. Although I don't know the restrictions to the standby screen I'm inquiring if it can even be done. I always give proper donations so there is incentive if you are interested. Thank you for the time to respond.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 08:28.