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)

coderus 2013-01-04 18:07

Re: [Support thread] Billboard Standby Screen
 
data counters in settings - device - counters. set limit to 300.

herno24 2013-01-04 18:14

Re: [Support thread] Billboard Standby Screen
 
Yes, now it works!!.

coderus 2013-01-04 18:26

Re: [Support thread] Billboard Standby Screen
 
lol, good :D

slarti 2013-01-04 22:01

Re: [Support thread] Billboard Standby Screen
 
One more:

I modified the bluetooth status script to show the correct icon for connected or disconnected states. No icon is shown when BT is off.

Code:

#!/usr/bin/python
# Print bluetooth status icon off/disconnected/connected

import dbus

bus = dbus.SystemBus()

bluez = bus.get_object('org.bluez', '/')
adapter_path = bluez.ListAdapters(dbus_interface='org.bluez.Manager')[0]
adapter = bus.get_object('org.bluez', adapter_path)
powered = adapter.GetProperties(dbus_interface='org.bluez.Adapter')['Powered']
btstatus = bus.get_object('com.nokia.policy.pcfd', '/com/nokia/policy/bluetooth_override')
connected = btstatus.Get(dbus_interface='org.maemo.contextkit.Property')[0]

if powered:
    if 'default' in connected:
        print '<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth-active.png>>'
    else:
        print '<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth.png>>'


herno24 2013-01-05 03:01

Re: [Support thread] Billboard Standby Screen
 
Ok, for gprs i think we need a script (i don't know how to do it) to reset the counter automatically every month. What do you think about this?.

coderus 2013-01-05 07:16

Re: [Support thread] Billboard Standby Screen
 
can be done by Timed script

coderus 2013-01-05 08:15

Re: [Support thread] Billboard Standby Screen
 
bluetooth icon shell script:
Code:

#!/bin/sh

powered=$(qdbus --system org.bluez $(qdbus --literal --system org.bluez / org.bluez.Manager.ListAdapters | sed -re "s/.*(\/org\/bluez\/[0-9]{4}\/hci0).*/\1/") org.bluez.Adapter.GetProperties $
connected=$(qdbus --system com.nokia.policy.pcfd /com/nokia/policy/bluetooth_override org.maemo.contextkit.Property.Get | sed -n 1p)
if [ "$powered" == "true" ]; then
        if [ "$connected" == "default" ]; then
                echo -n "<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth-active.png>>"
        else
                echo -n "<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth.png>>"
        fi
fi


EmaNymton 2013-01-05 09:25

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by herno24 (Post 1311058)
Ok, for gprs i think we need a script (i don't know how to do it) to reset the counter automatically every month. What do you think about this?.

Use the script with profilematic to check everyday if it's the day to reset. Not fully tested, before using it see your values with
Code:

gconftool-2 -R /cellui/settings/datacounter
and save it somewhere so you can manually recover.

Code:

#!/bin/sh
# reset the data counter on a selected reset day

reset_day="05" # change to your needs
day_of_month=$(date +"%d")
datetime=$(date +"%d.%m.%Y.%s")

if [ $reset_day = $day_of_month ]
then
gconftool -s --type string /cellui/settings/datacounter/transfer/gprs_home_tx_bytes "0"
gconftool -s --type string /cellui/settings/datacounter/transfer/gprs_home_rx_bytes "0"
gconftool -s --type string /cellui/settings/datacounter/general/gprs_home_last_reset $datetime
fi


slarti 2013-01-05 09:36

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by EmaNymton (Post 1311100)
Use the script with profilematic to check everyday if it's the day to reset.

Or set a calendar entry that repeats once a month and use ProfileMatic's calendar rule.

EmaNymton 2013-01-05 09:39

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by slarti (Post 1311102)
Or set a calendar entry that repeats once a month and use ProfileMatic's calendar rule.

thanks, didn't know that profilematic can do this, then you can trim the script to


Code:

#!/bin/sh
# reset the data counter
datetime=$(date +"%d.%m.%Y.%s")
gconftool -s --type string /cellui/settings/datacounter/transfer/gprs_home_tx_bytes "0"
gconftool -s --type string /cellui/settings/datacounter/transfer/gprs_home_rx_bytes "0"
gconftool -s --type string /cellui/settings/datacounter/general/gprs_home_last_reset $datetime


thp 2013-01-05 11:57

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by slarti (Post 1310872)
Thanks, that works. I guess something changed in the way this works with 1.7?

It's always been that way ;)

{propertyname?abc} is "output abc if propertyname is not empty"
{propertyname!abc} is "output abc if propertyname is empty"

The "not empty" part is also why {wazapp-status?abc} doesn't do what you expect - it won't be empty when you are offline (it will evaluate to "offline" instead).

The reason why the "?" doesn't output the property name is that you can do something like this:

Code:

{song?Now playing: }{song}{song?
}


thp 2013-01-05 11:57

Re: [Support thread] Billboard Standby Screen
 
Thanks, the Bluetooth status icon scripts have been merged. I wonder if we should also (in a subdirectory) include scripts such as resetting the data counters, forcing the update by re-setting the text, etc.. in the "billboard-scripts" repository, even if some of them don't really depend on Billboard - what do you think?

slarti 2013-01-05 16:24

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by coderus (Post 1311078)
can be done by Timed script

[offtopic]

Coderus, do you know how to set an event to the timed daemon using a shell or python script? I know that on the system bus there is:

Code:

com.nokia.time /com/nokia/time com.nokia.time.add_event(QDBus
RawType::(iuuuuus(a{ss} x)

but I have no idea how to use this. Do you?

[/offtopic]

slarti 2013-01-05 16:25

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by thp (Post 1311120)
Thanks, the Bluetooth status icon scripts have been merged. I wonder if we should also (in a subdirectory) include scripts such as resetting the data counters, forcing the update by re-setting the text, etc.. in the "billboard-scripts" repository, even if some of them don't really depend on Billboard - what do you think?

Probably a good idea. There is some demand for these and some sort of a repo for them can't hurt.

Edit: I just remembered there is one more script that has to do with Billboard in the ProfileMatic thread.

Sir_Krokofant 2013-01-07 11:49

Re: [Support thread] Billboard Standby Screen
 
Hi !
I would like a 'nameday' (swedish) script, it would be nice to show it on the Billboard screen.
Has anyone the knowledge to do that ? ( I can't).

thp 2013-01-08 13:15

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Sir_Krokofant (Post 1311852)
I would like a 'nameday' (swedish) script, it would be nice to show it on the Billboard screen.

If by "nameday" you mean something like this:

http://stjarnhimlen.se/ndag/ndag2001.html

Then you could start by transforming that page into a text file (one day per line) in a way that you can parse by a script and then write a small shell script that greps the right day out of it, e.g.:

Code:

~ $ cat nameday.txt
01.01. Nyårsdagen
02.01. Svea
...
08.01. Erland
...
~ $ awk "/^$(date +%d.%m.)/ { print "'$2'" }" nameday.txt
Erland

So the "nameday.txt" contains the names on each line (DD.MM. NAME), and the awk command gets today's name based on that. I've added a script to billboard-scripts, but you will have to write (copy'n'paste or process) your nameday.txt yourself :)

coderus 2013-01-08 13:35

Re: [Support thread] Billboard Standby Screen
 
@slarti i only used Timed in C++. not sure about python module for timed.

slarti 2013-01-08 16:04

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by coderus (Post 1312305)
@slarti i only used Timed in C++. not sure about python module for timed.

Well, I haven't found one... I'm guessing it's a struct of some kind you have to feed it but I'm completely clueless as to what the syntax is. Oh well, I guess I'll manage with ProfileMatic and it's timing rules.

Boxeri 2013-01-08 18:38

Re: [Support thread] Billboard Standby Screen
 
Hi

I would like to use the "color-battery-bar" property in such a way, that it would change color when battery level goes below 30%. I have tried to find it out myself, but as I know absolutely nothing about coding this is not easy.

I tried with http://docs.python.org/2/tutorial/ and came up with idea of using an IF-statement. But I can't make it to work, maybe somebody could help me? I am way too lost here...

if [ {color-battery-bar} {battery} >30 ]
then
echo {{green}}"%"
else
echo {{red}}"%"

Sir_Krokofant 2013-01-08 18:47

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by thp (Post 1312300)
If by "nameday" you mean something like this:

http://stjarnhimlen.se/ndag/ndag2001.html

Then you could start by transforming that page into a text file (one day per line) in a way that you can parse by a script and then write a small shell script that greps the right day out of it, e.g.:

Code:

~ $ cat nameday.txt
01.01. Nyårsdagen
02.01. Svea
...
08.01. Erland
...
~ $ awk "/^$(date +%d.%m.)/ { print "'$2'" }" nameday.txt
Erland

So the "nameday.txt" contains the names on each line (DD.MM. NAME), and the awk command gets today's name based on that. I've added a script to billboard-scripts, but you will have to write (copy'n'paste or process) your nameday.txt yourself :)

Looks nice and simple, will try it, thanks !

coderus 2013-01-08 20:00

Re: [Support thread] Billboard Standby Screen
 
@Boxeri there are no interpreter in Billboard. you should make your own color bar for custom colors.

Boxeri 2013-01-09 14:53

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by coderus (Post 1312452)
@Boxeri there are no interpreter in Billboard. you should make your own color bar for custom colors.

Ok. Can I use color codes? As I don't know how to make a script that would even change the color to begin with, I am certain that trying to create my own color bar would be next to impossible for me :p

ruplee76 2013-01-09 15:18

Re: [Support thread] Billboard Standby Screen
 
can we see psm and normal mode on lp screen with billboard?? If yes can somebody provide the required mod/script??

thedead1440 2013-01-09 16:44

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Boxeri (Post 1312413)
change color when battery level goes below 30%.

Maybe you want something like this:

Code:

#!/bin/sh

# lshal command thanks to joerg_rw #

status=$(lshal | grep -v grep | grep battery.charge_level.percentage | awk '{print $3}' | head -1)

if [[ $status -ge 30 ]]
then
echo {{green}} $status %
else
echo {{red}} $status %
fi

It will echo for example as 75 % in green and 29 % in red

Zvjer 2013-01-09 18:24

I installed 1.0.7 via inception and what happened my standby screen which usually changes position once per minute or so, now changes position 20+ times per second!!!

uninstalled billboard and rebooted, problem remains.

installed it again and now it's ok. I have no idea how that happened :-)

coderus 2013-01-09 18:59

relax. every second many peoples on earth doing something stupod. you not alone.

Boxeri 2013-01-09 20:49

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by thedead1440 (Post 1312879)
Maybe you want something like this:

Code:

#!/bin/sh

# lshal command thanks to joerg_rw #

status=$(lshal | grep -v grep | grep battery.charge_level.percentage | awk '{print $3}' | head -1)

if [[ $status -ge 30 ]]
then
echo {{green}} $status %
else
echo {{red}} $status %
fi

It will echo for example as 75 % in green and 29 % in red

Thanks again for this Thedead!

I am, however, doing something wrong as Billboard is not giving anything with this script. I ran it in terminal and it did give the battery status there. But when save it as battery.py to /home/user and write to billboard {script:/home/user/battery.py} there is nothing as an output.

herno24 2013-01-09 21:34

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Boxeri (Post 1312996)
Thanks again for this Thedead!

I am, however, doing something wrong as Billboard is not giving anything with this script. I ran it in terminal and it did give the battery status there. But when save it as battery.py to /home/user and write to billboard {script:/home/user/battery.py} there is nothing as an output.

It's a .sh script, not a .py.

Boxeri 2013-01-09 21:46

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by herno24 (Post 1313011)
It's a .sh script, not a .py.

Yes, I noticed that also. But even though I tried with .sh, I still could't get it to work :confused:

Is it ok to make it with notepad and save em with UTF-8 coding? Am I doing something wrong there?

thedead1440 2013-01-10 04:43

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Boxeri (Post 1313016)
Yes, I noticed that also. But even though I tried with .sh, I still could't get it to work :confused:

Is it ok to make it with notepad and save em with UTF-8 coding? Am I doing something wrong there?

UTF-8 coding is fine but why not just copy and paste into nano on device via SSH or regularly?

Also chmod 775 the script and make sure its not in ~/MyDocs partition but in /home/user/

coderus 2013-01-10 07:23

Re: [Support thread] Billboard Standby Screen
 
you should do {script:sh /home/user/battery.sh} or if want to use {script:/home/user/battery.sh} you should do chmod +x /home/user/battery.sh

Zvjer 2013-01-10 10:30

Re: [Support thread] Billboard Standby Screen
 
I can confirm that wazapp-status in 1.0.7 does not do it's job. My wazapp crashed a few minutes ago, and I did not start it again because I'm waiting on the standby screen to see if billboard will understand that wazapp is crashed but no - it still says "online".

coderus 2013-01-10 10:47

Re: [Support thread] Billboard Standby Screen
 
you silly :) who will update context value if process crashed? :D

Zvjer 2013-01-10 12:22

Maybe not update but empty it? Return it to the state in which it is after a device reboot, before wazapp launched for the first time.

Zvjer 2013-01-10 16:26

Right now I'm on a WiFi router with broken internet connection. Nothing works, but wazapp thinks he is online, but it's not. Billboard thinks we are online too. Useless plugin? NHF.

Win7Mac 2013-01-10 16:33

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Zvjer (Post 1313331)
Billboard thinks we are online too.

It displays the connection to your router, nothing beyond that.
Fix your internet connection, don't blame BB... ;)

Win7Mac 2013-01-10 16:35

Re: [Support thread] Billboard Standby Screen
 
Again, thedead1440 was kind enough to help me with a script.
We extended his script for colored battery %, tested a bit and this seems to work, even with other text in the same line:
Code:

#!/bin/sh

status=$(lshal | grep -v grep | grep battery.charge_level.percentage | awk '{print $3}' | head -1)

if [[ $status -ge 50 ]]
then
printf "{{green}} $status"
fi
if [[ $status -ge 25 && $status -le 49 ]]
then
printf "{{yellow}} $status"
fi
if [[ $status -le 24 ]]
then
printf "{{red}} $status"
fi

You only have to put the % in the BB-text, the color for it (and the rest of the line) will be the same as for actual percentage.
This will give you 100-50%, 49-25% and 24-0%. :)
Now if you want further info in that same line after the "%" in a different color, just add {{color}} before the text to come next.

EDIT: The following is already solved by slartis' *Ultimate Customizable Event + Alarm Attribute Getter*™.
Here's what I can't get to work:
  • - {{blue}}{events}{events? ☚} only works as desired if there's 1 event.
    If there's 2 or more, only the first is shown blue (the rest is white) and only the last has the ☚ (which is obvious)
and
  • - {script: /home/user/alarm.py} is not showing at all with the last line of script edited to
    Code:

    sys.stdout.write('\n'.join(sorted(get_queued_alarms())))
    instead of
    Code:

    print '\n'.join(sorted(get_queued_alarms())) or 'No alarms'
    This modification is supposed to enable special characters in the BB text, but I get nothing at all.

Any help on this would be great.
Would it be possible to get events and alarms via shell script too?

slarti 2013-01-10 16:37

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Zvjer (Post 1313331)
Right now I'm on a WiFi router with broken internet connection. Nothing works, but wazapp thinks he is online, but it's not. Billboard thinks we are online too. Useless plugin? NHF.

[rant]

Would the people who complain about a FREE open source whatsapp client developed by talented people in their spare time keep their complaining in the wazapp thread, please.

FFS, the only useless things here are the people who haven't heard of a 20-year old technology called SMS which works very reliably everywhere between ALL phones without the need for a proprietory piece of crap.

[/rant]

Burlone 2013-01-10 17:07

Re: [Support thread] Billboard Standby Screen
 
I can not run the script for the battery percentage color

Win7Mac 2013-01-10 17:17

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Burlone (Post 1313354)
I can not run the script for the battery percentage color

Coding set to UTF-8 and UNIX? Then put it in /home/user/ and run as user in terminal: chmod +x /home/user/yourscriptname.sh
That should be it.


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

vBulletin® Version 3.8.8