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)

Win7Mac 2013-06-30 18:36

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Quaddy (Post 1355381)
@Win7Mac - are you able to answer seeing as you were such a big fan of the script :) can your event getter by slarti show more than one line on bb, or just one? thnx

Saw your initial post and I have no clue, sorry.
After mine stopped working for 2 weeks or so, all is back to normal. No idea what happened, I did nothing to the system or BB in that time. I use max. 3 events/lines for next 3 days.

AFAIK, there is no line limitation within billboard for external scripts.
My advice would be to double check the script again (or better delete and copy/paste the original again) or ask slarti.
Good luck!

Quaddy 2013-07-20 18:12

Re: [Support thread] Billboard Standby Screen
 
on the "next_alarm_only.py" in the billboard scripts, does anyone know how to have it literally print "tomorrow" or "today" if the alarm is tomorrow or today, rather than the name of the day?


@Win7Mac - thanks, got it working

slarti 2013-07-22 12:32

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Quaddy (Post 1360465)
on the "next_alarm_only.py" in the billboard scripts, does anyone know how to have it literally print "tomorrow" or "today" if the alarm is tomorrow or today, rather than the name of the day?


@Win7Mac - thanks, got it working

Sorry for the late answer. My N9 broke and I haven't been around here much.

Like I said, next_alarm_only.py kind of sucks. Don't use it. I can say that because I wrote it.

Here I've modified the much better customizable_alarm_lister.py to print 'Today' if the alarm is today, 'Tomorrow' if it's tomorrow and the day of the week if it's something else. The variable weekday needs to be included in the last line for it to work.

I have absolutely no idea why it didn't work for you before, but I'm glad you got it sorted.

Code:

#!/usr/bin/python
# Print various attributes of alarm(s) by modifying various things
# Author: slarti

import dbus
from datetime import datetime, timedelta, date

bus = dbus.SystemBus()

time_obj = bus.get_object('com.nokia.time', '/com/nokia/time')
time_intf = dbus.Interface(time_obj, 'com.nokia.time')
alarm_obj = bus.get_object('com.nokia.time', '/org/maemo/contextkit/Alarm/Trigger')
alarms = alarm_obj.Get(dbus_interface='org.maemo.contextkit.Property')[0]
cookies = alarms[0].keys()
alarms_list = []
for cookie in cookies:
        timestamp = alarms[0][cookie]
        attributes = time_intf.query_attributes(cookie)
        alarms_list.append(((timestamp,cookie,attributes)))

alarms_list.sort()

# Change these to your own language in the order
# they are in if you want to print the weekday:

abb_weekdays = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']

# Choose the limit for the number of alarms (lines) to print:

limit = 5

# If you want to print "No alarms", if there are none,
# leave this as is (the string can be changed).
# If you don't want it, comment this out or delete it:

if len(alarms_list) == 0:
        print 'No alarms'

# Don't touch this:

if len(alarms_list) < limit:
        limit = len(alarms_list)

# This generates what to print on every line:

for i in range(limit):

# Don't touch this:

        alarm_timestamp = datetime.fromtimestamp((alarms_list[i][0])/1000000000)

# You can choose from these:

        if date.weekday(alarm_timestamp) == date.weekday(datetime.now()):
            weekday = 'Today'
        elif date.weekday(alarm_timestamp) == date.weekday(datetime.now() + timedelta(days=1)):
            weekday = 'Tomorrow'
        else:
            weekday = abb_weekdays[date.weekday(alarm_timestamp)]
        title = alarms_list[i][2]['TITLE']
        alarmtime = datetime.strftime(alarm_timestamp,"%H:%M")
        time_to_alarm = ':'.join(str(alarm_timestamp - datetime.now()).split(':')[:2])
        snooze = alarms_list[i][2]['snooze']+'min'

# This is the special character. Look for the Python source code
# string at e.g. http://www.fileformat.info/info/unicode/block/index.htm

        sc = u"\u2691"

# Here you can decide what to print in which order:

        print (weekday+' '+title+' '+alarmtime+' '+time_to_alarm+' '+snooze+' '+sc).encode('utf-8')


Quaddy 2013-07-22 12:55

Re: [Support thread] Billboard Standby Screen
 
thats brilliant, many thanks for the script!!!!!

RR_aus_H 2013-07-24 18:04

Re: [Support thread] Billboard Standby Screen
 
I tried to use the "bluetooth_status.py" script in BB
and added the following line to the configuration:

{script:/home/user/MyDocs/blutooth_status.py}

But nothing happens.
Have I forgot something, should the File be executable?
The other Things in Billboard are working fine.

Thanks for any Help

Win7Mac 2013-07-24 20:27

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by RR_aus_H (Post 1361802)
{script:/home/user/MyDocs/blutooth_status.py}

But nothing happens.

You have a typo there, should be
{script:/home/user/MyDocs/bluetooth_status.py} I guess.

Quote:

Originally Posted by RR_aus_H (Post 1361802)
Have I forgot something, should the File be executable?

All scripts need permission (chmod +x).

RR_aus_H 2013-07-24 20:53

Re: [Support thread] Billboard Standby Screen
 
Hello Win7Mac,
you are right, I made a mistake by typewriting the line of my N9.
But the original is correct.
Now I try to make the script executable.

Thanks for the Help

Win7Mac 2013-07-24 21:00

Re: [Support thread] Billboard Standby Screen
 
no problem, just hit the thanks button, it's good practice here ;)

slarti 2013-07-25 14:32

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Win7Mac (Post 1361850)
All scripts need permission (chmod +x).

This is not strictly true. I usually put my scripts in /home/user and simply run them with the interpreter {script: python script.py). That way there is no need to type in a path or chmod the scripts.

Quaddy 2013-07-27 19:16

Re: [Support thread] Billboard Standby Screen
 
thanks slarti, i had all my scripts in /home/user and did not realize i could cut out the path, has certainly saved some clutter and space in billboard now! very neat! :)

Mikkosssss 2013-08-28 08:14

Re: [Support thread] Billboard Standby Screen
 
Is there way to make script that tells if phone is locked with security code?
I use long delay+secure device script from N9Qt so I dont alway remember is my phone locked or not and have to check it before I leave it.
This would make it much easier.

Thanks

slarti 2013-08-28 15:50

Re: [Support thread] Billboard Standby Screen
 
Code:

qdbus --system com.nokia.devicelock /request com.nokia.devicelock.getState 1
Will probably get you the current state of devicelock. I'll leave the rest to you.

Schturman 2013-08-28 16:22

Re: [Support thread] Billboard Standby Screen
 
Also, if you already used it with N9QT, you can use profilematic:
Code:

sh -c "sh /opt/N9QTweak/Secure/device_secure.sh"

Mikkosssss 2013-08-28 17:11

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Schturman (Post 1370148)
Also, if you already used it with N9QT, you can use profilematic:
Code:

sh -c "sh /opt/N9QTweak/Secure/device_secure.sh"

Theres build in delay feature in N9 so why would I use profilematic. :p

I just make so that it shows in LPS that device is secured.

And thanks for help Slarti I think that will do. :)

Quaddy 2013-08-28 18:47

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by thp (Post 1338731)
Yes, write a Python script and use it using {script:/path/to/yourscript.py} like this:

Code:

import feedparser
f = feedparser.parse('http://example.org/feed.rss')
print f.entries[0].title


this is excellent! i have written a python script with your instructions, and it will work when i probe the script via command, eg python /home/user/rss.py, it shows the news headline output fine in the command window, but for some reason it just never displays in billboard, just blank!

what am i doing wrong? :p

Schturman 2013-08-28 19:03

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Mikkosssss (Post 1370162)
Theres build in delay feature in N9 so why would I use profilematic. :p

I just make so that it shows in LPS that device is secured.

And thanks for help Slarti I think that will do. :)

Sorry, not understanded your question before.. :)

Mikkosssss 2013-08-28 20:17

Re: [Support thread] Billboard Standby Screen
 
Its ready now:

Code:

#!/bin/sh
#Tell if device is secured by security code

reply=$(qdbus --system com.nokia.devicelock /request com.nokia.devicelock.getState 1)
if [ "$reply" == "0" ]; then
    echo "Not Secure"
else
    echo "Secured"
fi

Is there any way to get it update faster?
Now it takes long to change to right.

Edit: Found way from this thread, will test soon. :)

Edit2: Is there good white lock icon in phone or do I need to make my own? :p

Schturman 2013-08-28 20:17

Re: [Support thread] Billboard Standby Screen
 
Noticed that billboard stoped to show my month script:
Code:

#!/bin/sh

month=$(date +%m)
echo | awk -v d=$((month)) '{split("בינואר,בפברואר,במרץ,באפריל,במאי,ביוני,ביולי,באוגוסט,בספטמבר,באוקטובר,בנובמבר,בדצמבר",a,","); printf a[d]}'

I run it like this:
Code:

{script:sh /home/user/my_month.sh}
Don't know what a reason that it stoped to work....
Any help ?
Thanks

lancewex 2013-08-28 23:50

Re: [Support thread] Billboard Standby Screen
 
I want to become more familiar with the Celsius scale. Is there a way to display Fahrenheit and Celsius temperatures at the same time with Billboard/Meecast?

Mikkosssss 2013-08-29 06:33

Re: [Support thread] Billboard Standby Screen
 
You could make script that does multiply C by 1.8, and then add 32.
Then you get F. :)

slarti 2013-08-29 14:05

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Mikkosssss (Post 1370239)
Edit2: Is there good white lock icon in phone or do I need to make my own? :p

http://www.fileformat.info/info/unic...f512/index.htm

unlocked:

http://www.fileformat.info/info/unic...f513/index.htm

slarti 2013-08-29 15:03

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Schturman (Post 1370240)
Noticed that billboard stoped to show my month script:
Code:

#!/bin/sh

month=$(date +%m)
echo | awk -v d=$((month)) '{split("בינואר,בפברואר,במרץ,באפריל,במאי,ביוני,ביולי,באוגוסט,בספטמבר,באוקטובר,בנובמבר,בדצמבר",a,","); printf a[d]}'

I run it like this:
Code:

{script:sh /home/user/my_month.sh}
Don't know what a reason that it stoped to work....
Any help ?
Thanks

There is an arithmetic syntax error in the index of the month. $month at the moment returns the string "08" and $((month)) returns the error. I really have no idea why this is so and can't be arsed to find out.

In python, it would be something like this:

Code:

#!/usr/bin/python
from datetime import datetime

months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
month = months[datetime.now().month-1]
print month


Mikkosssss 2013-08-29 15:09

Re: [Support thread] Billboard Standby Screen
 
At first I trought that those are good. But when I tried em I realised that icons wont show because they are black+transparent not white. :D
I might just invert those.

slarti 2013-08-29 15:13

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Mikkosssss (Post 1370440)
At first I trought that those are good. But when I tried em I realised that icons wont show because they are black+transparent not white. :D
I might just invert those.

They show up just fine for me in any color I have set up in BB. Are you sure your font supports it and you can see it at command line?

Mikkosssss 2013-08-29 16:00

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by slarti (Post 1370442)
They show up just fine for me in any color I have set up in BB. Are you sure your font supports it and you can see it at command line?

Well I dont know how to use those as character so I used them as png. :D
Just copy one of those codes to my script?
Whitch encoding it is?

slarti 2013-08-29 16:20

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Mikkosssss (Post 1370451)
Well I dont know how to use those as character so I used them as png. :D

:D
Quote:

Originally Posted by Mikkosssss (Post 1370451)
Just copy one of those codes to my script?

Yes, in hex format.
Quote:

Originally Posted by Mikkosssss (Post 1370451)
Whitch encoding it is?

Billboard expects UTF-8.

Try

Code:

echo -ne '\xF0\x9F\x94\x93'

Mikkosssss 2013-08-29 16:39

Re: [Support thread] Billboard Standby Screen
 
Billboard doesnt know that character so its only square. :(

Schturman 2013-08-29 19:10

Re: [Support thread] Billboard Standby Screen
 
1 Attachment(s)
Quote:

Originally Posted by slarti (Post 1370437)
There is an arithmetic syntax error in the index of the month. $month at the moment returns the string "08" and $((month)) returns the error. I really have no idea why this is so and can't be arsed to find out.

In python, it would be something like this:

Code:

#!/usr/bin/python
from datetime import datetime

months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
month = months[datetime.now().month-1]
print month


Thank you very much ! Now it work again :)
But now I see year in the second line.. In previous version of script (when it worked) it shown year also in the first line with day of week, date, name of month..
Can i somehow get the year in the first line too ?
Thanks

lancewex 2013-08-29 19:15

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Mikkosssss (Post 1370301)
You could make script that does multiply C by 1.8, and then add 32.
Then you get F. :)

Someone could, but *I* can't. :-j

Quaddy 2013-08-29 22:59

Re: [Support thread] Billboard Standby Screen
 
try adding
Code:

chr(0)
right at the end of your month script

Quote:

Originally Posted by Schturman (Post 1370519)
Thank you very much ! Now it work again :)
But now I see year in the second line.. In previous version of script (when it worked) it shown year also in the first line with day of week, date, name of month..
Can i somehow get the year in the first line too ?
Thanks


Schturman 2013-08-29 23:50

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Quaddy (Post 1370544)
try adding
Code:

chr(0)
right at the end of your month script

Thanks, but not helped... The "year" is still on the second line.

Quaddy 2013-08-30 00:15

Re: [Support thread] Billboard Standby Screen
 
Schturman wrote:

Quote:

"Thanks, but not helped... The "year" is still on the second line."
lets try adding the space in the script after each month eg. ('Jan ','Feb '), and removing single space in billboard immediately before {year} incase thats somehow breaking line

also adding +chr(0) after print function to remove spaces

try this as a test, in principle. (i know its not right language) :) but it works here:

Code:

#!/usr/bin/python
from datetime import datetime

months = ['Jan ','Feb ','Mar ','Apr ','May ','Jun ','Jul ','Aug ','Sep ','Oct ','Nov ','Dec ']
month = months[datetime.now().month-1]
print (month)+chr(0)

billboard:

Code:

...etc...
{day} {script: python /home/user/my_month_he.py}{year}
{ip}
...etc...

p.s. if your script is is /home/user directory, no need to specify path in billboard, just {script: python my_month_he.py} will suffice!

:)

slarti 2013-08-30 04:22

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Mikkosssss (Post 1370468)
Billboard doesnt know that character so its only square. :(

If you type in BB

Code:

{script:echo -ne \xF0\x9F\x94\x93}
...the result is a box? Then your font doesn't support it.

Quote:

Originally Posted by Schturman (Post 1370519)
Thank you very much ! Now it work again :)
But now I see year in the second line.. In previous version of script (when it worked) it shown year also in the first line with day of week, date, name of month..
Can i somehow get the year in the first line too ?
Thanks

Use stdout instead of print to get rid of the new line or print the year in the script with:

Code:

datetime.now().year

Schturman 2013-08-30 05:14

Re: [Support thread] Billboard Standby Screen
 
Thanks, i still try both options, but later when i will open my PC. For some reasons if i edit this script on the phone, script stop to work.. Probably somehow encoding changed when i save file.

Schturman 2013-08-30 08:11

Re: [Support thread] Billboard Standby Screen
 
Ok, tested...
Quaddy, I just added "print month+chr(0)" and it did a job! Now show like I want. Thanks :)
Not needed spaces in month names and not needed removing single space in billboard immediately before {year} :)
Probably in my first test I forgot to add "+"...

slarti, using "stdout month" instead "print month" - the month name disappeared.
Adding "print datetime.now().year" - the year also appeared on the second line :)

Win7Mac 2013-08-30 09:35

Re: [Support thread] Billboard Standby Screen
 
Schturman, try 'printf' instead of 'print' in your script.
But why not handle the whole date in the script, that'd for sure give you 1 line? ;)

Schturman 2013-08-30 09:40

Re: [Support thread] Billboard Standby Screen
 
Will try with prinf later too.. Not tried to put all in one script.. But like said i tired to add year to this script and it jumped to second line..

dannejanne 2013-08-30 17:38

Re: [Support thread] Billboard Standby Screen
 
Started using a theme today and the billboard info is misaligned. It's pushed to the right and the info is cutoff a lot. Is there some kind of fix for this?

chilango 2013-09-04 02:52

Re: [Support thread] Billboard Standby Screen
 
hy thp,

for the problems with N9QTweak i had reinstall billboard a lot of times. Now Nokia Store dont let me do it again. I had reinstalled from BackDeb-folder with devel-su and

dpkg -i billboard_1.0.9_armel.deb

without an error.
In Manage Applications it looks fine. Only i didnt have an icon to start on the screen.
Can you help me?

Mikkosssss 2013-09-04 05:58

Re: [Support thread] Billboard Standby Screen
 
Does it work from terminal. Code:

Code:

/opt/billboard/bin/billboard-ui


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

vBulletin® Version 3.8.8