Notices


Reply
Thread Tools
Posts: 49 | Thanked: 8 times | Joined on Oct 2013
#1011
If I run this network.sh script in terminal I get 'permission denied' error.
This might be the problem. But I don't know how to fix it.
 
Posts: 49 | Thanked: 8 times | Joined on Oct 2013
#1012
The script updates every couple of seconds so expect a slight increase of battery drain.

Thanks for the great solution.
Which section causes the battery drain, the signal.sh or the {cell-signal-strength}?
I didn't know about the {cell-signal-strength} command for Billboard.
Is there a list of all the commands for Billboard?
Thanks
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#1013
Originally Posted by fhutt View Post
I didn't know about the {cell-signal-strength} command for Billboard.
Is there a list of all the commands for Billboard?
Actually all of them should be available from the UI or documented in the about box, but I just noticed that cell-signal-strength and cell-signal-bars were missing, so I've added that now. Will be part of the next release.
 

The Following User Says Thank You to thp For This Useful Post:
Posts: 58 | Thanked: 19 times | Joined on Jan 2012 @ Finland
#1014
Originally Posted by slarti View Post
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.
Is there a way of localizing day names, or is the output always in english like "Mon" ,"Tue" etc. ?
 
Posts: 49 | Thanked: 8 times | Joined on Oct 2013
#1015
Win7Mac's implementation of showing Flight mode is very clever.
It assumes that no output from {cell-segnal-strength) means that Flight mode must be active.
Is this a true assumption seeing that at times the phone may be searching for a signal and may be in between buildings or in the outback? Or, maybe during those times the output may be 0%.
Thanks

Last edited by fhutt; 2013-10-27 at 23:30. Reason: Correction
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1016
Originally Posted by Z3tor View Post
Is there a way of localizing day names, or is the output always in english like "Mon" ,"Tue" etc. ?
Yes. Use my much improved customizable_alarm_lister.py.
 

The Following User Says Thank You to slarti For This Useful Post:
Posts: 58 | Thanked: 19 times | Joined on Jan 2012 @ Finland
#1017
Doh. I totally missed that in github scripts. Thanks.
 
Posts: 58 | Thanked: 19 times | Joined on Jan 2012 @ Finland
#1018
@slarti
I tried your events listener scrpt but get this error. I cant figure out whats wrong.

$ python /home/user/events.py
File "/home/user/events.py", line 19
attributes = time_intf.query_attributes(cookie)
^
IndentationError: expected an indented block
 
Mikkosssss's Avatar
Posts: 645 | Thanked: 519 times | Joined on Apr 2012 @ Finland
#1019
Just googled your error and results say that you have mixed spaces and tabs.
__________________
────────────────────
Try:My N9 bootvideo
 
Posts: 58 | Thanked: 19 times | Joined on Jan 2012 @ Finland
#1020
i already removed all tabs from code but get the same error.

Edit:

Sorted it. So Python is picky about intendation.

Edit2:

Script works now, but scandic letters in code give errors. How to set encoding for finnish?

Last edited by Z3tor; 2013-10-28 at 20:45.
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:41.