maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Support thread] Billboard Standby Screen (https://talk.maemo.org/showthread.php?t=84507)

slarti 2012-06-16 06:58

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by achilles333 (Post 1221869)
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!:D

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?

thedead1440 2012-06-16 07:25

Re: [Support thread] Billboard Standby Screen
 
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...

zimmerit 2012-06-17 16:16

Re: [Support thread] Billboard Standby Screen
 
This app is brilliant! =)

Hopefully author will update it with new features

WhitP 2012-06-19 00:21

Re: [Support thread] Billboard Standby Screen
 
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 2012-06-19 09:46

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by WhitP (Post 1223960)
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

WhitP 2012-06-19 12:25

Re: [Support thread] Billboard Standby Screen
 
Works like a charm with Profilematic.
May as well leave it in place as I don't need Billboard when I'm asleep!

slarti 2012-06-19 13:49

Re: [Support thread] Billboard Standby Screen
 
1 Attachment(s)
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' :cool:

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.

bnwg 2012-06-19 15:10

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by WhitP (Post 1224153)
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.

WhitP 2012-06-19 17:41

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by bnwg (Post 1224219)
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

justadude 2012-06-20 02:30

Re: [Support thread] Billboard Standby Screen
 
@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. :)


All times are GMT. The time now is 02:24.

vBulletin® Version 3.8.8