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 2013-03-27 15:26

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by herno24 (Post 1332233)
Yes, i don't know, i works because via terminal it shows the path of the icons but billboard desn't show it.

The magic line is this:

{script: develsh signalbar.sh}

Quote:

Originally Posted by thp (Post 1332157)
You can't nest {} like that in Billboard. I'll see what I can do for future versions. You can work around that by doing the checking in the script and removing the {network-name? } around it.

I may have been the one to suggest doing this...:o
It does work when the property is not empty. For example, {battery?{script:sh battery.sh}} works as expected. When the property is empty, the trouble starts.

Quote:

Originally Posted by Win7Mac (Post 1332178)
And how do I call network-name with a script?

Code:

networkname=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkName org.maemo.contextkit.Property.Get | sed q)

Win7Mac 2013-03-28 11:02

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

Originally Posted by thp (Post 1332157)
You can't nest {} like that in Billboard. I'll see what I can do for future versions. You can work around that by doing the checking in the script.

As {cell-signal-strength} gets updated most often in BB, it'd be nice to be able to tie any script to it.
Calling it via script only like in 1.0.7 doesn't update that often. :(

Quote:

Originally Posted by slarti (Post 1332237)
It does work when the property is not empty.

There really is no such thing as calling an empty state of a service?

So I merged {network-name} into data-mode.sh and have a strange output... when no network present:
https://dl.dropbox.com/s/digazd1o5mu...etworkname.png
With this script
Code:

#!/bin/sh

DT=$(develsh -c "qdbus --system com.nokia.csd.CSNet /com/nokia/csd/csnet com.nokia.csd.CSNet.RadioAccess.DataTechnology")
NT=$(develsh -c "qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkType org.maemo.contextkit.Property.Get | sed q")
NN=$(develsh -c "qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkName org.maemo.contextkit.Property.Get | sed q")
wlan='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-wlan-cyan.png>>'
umts='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-3g-yellow.png>>'
egprs='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-25g-yellow.png>>'
gprs='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-gsm-red.png>>'
hspa='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-35g-green.png>>'
echo -n "$NN "
if [ $NT == "WLAN" ]
then echo -n $wlan
else if [ $DT == "GPRS" ]
then echo -n $gprs
else if [ $DT == "EGPRS" ]
then echo -n $egprs
else if [ $DT == "UMTS" ]
then echo -n $umts
else if [ $DT == "HSPA" ]
then echo -n $hspa
fi
fi
fi
fi
fi

So what workaround, put a dummy dbus service and adjust the output of it?


Also, I wonder what happens with shades of a color in LPM, like here:

thedead1440 2013-03-28 11:41

Re: [Support thread] Billboard Standby Screen
 
Your strange output seems to be your IMEI that is now posted for all to see :)

Win7Mac 2013-03-28 11:48

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by thedead1440 (Post 1332483)
Your strange output seems to be your IMEI that is now posted for all to see :)

If you really think so then thank you for posting here instead of sending me a discrete pm... :rolleyes:

But it's not, the number changes randomly.
I posted the script, no IMEI gets called, it's the networkname when no data network present.

Win7Mac 2013-03-28 21:37

Re: [Support thread] Billboard Standby Screen
 
I've reworked some icons, they're all single color with transparent background now:
https://www.dropbox.com/sh/ry67p8djb4hidcy/tbRlrVTWQd

Win7Mac 2013-03-30 02:03

Re: [Support thread] Billboard Standby Screen
 
I don't understand why a data-connection is detected when obviously there isn't/shouldn't be one.
Is it possible to put a condition in the script for network-name that if it's numbers only (like a wildcard for any number-only), it outputs nothing?
Other ideas of getting rid of the numbers from network-name?

thedead1440 2013-03-30 04:02

Re: [Support thread] Billboard Standby Screen
 
Win7Mac,

If you want to check for a number in your output and give an empty output while giving a non-empty output when there is an alphabet with the number you could use test this way:

Code:

test -z "$NN" -o -n "`echo $NN | tr -d '[0-9]'`" && echo $NN

coderus 2013-03-30 08:32

Re: [Support thread] Billboard Standby Screen
 
Code:

state=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkState org.maemo.contextkit.Property.Get)
if [ "$state" = "connected" ]
blah-blah
fi

isn't it what you searching for?

Win7Mac 2013-03-30 11:34

Re: [Support thread] Billboard Standby Screen
 
^^ Exactly! Thanks coderus. :)
This works as desired:
Code:

#!/bin/sh

DT=$(develsh -c "qdbus --system com.nokia.csd.CSNet /com/nokia/csd/csnet com.nokia.csd.CSNet.RadioAccess.DataTechnology")
NT=$(develsh -c "qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkType org.maemo.contextkit.Property.Get | sed q")
NN=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkName org.maemo.contextkit.Property.Get | sed q)
state=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkState org.maemo.contextkit.Property.Get | sed q)
wlan='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-wlan-cyan.png>>'
umts='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-3g-yellow.png>>'
egprs='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-25g-yellow.png>>'
gprs='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-gsm-red.png>>'
hspa='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-35g-green.png>>'
if [[ $state == "connected" && $NT == "WLAN" ]]
then echo -n "{{cyan}}$NN $wlan"
else if [[ $state == "connected" && $DT == "GPRS" ]]
then echo -n "{{yellow}}$NN $gprs"
else if [[ $state == "connected" && $DT == "EGPRS" ]]
then echo -n "{{yellow}}$NN $egprs"
else if [[ $state == "connected" && $DT == "UMTS" ]]
then echo -n "{{yellow}}$NN $umts"
else if [[ $state == "connected" && $DT == "HSPA" ]]
then echo -n "{{yellow}}$NN $hspa"
fi
fi
fi
fi
fi


coderus 2013-03-31 05:12

Re: [Support thread] Billboard Standby Screen
 
@Win7Mac this style of coding more intelligent:
Code:

#!/bin/sh

state=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkState org.maemo.contextkit.Property.Get | sed q)
wlan='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-wlan-cyan.png>>'
umts='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-3g-yellow.png>>'
egprs='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-25g-yellow.png>>'
gprs='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-gsm-red.png>>'
hspa='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-35g-green.png>>'
if [[ $state == "connected" ]]; then
    NT=$(develsh -c "qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkType org.maemo.contextkit.Property.Get | sed q")
    NN=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkName org.maemo.contextkit.Property.Get | sed q)
    if [[ $NT == "WLAN" ]]; then
        echo -n "{{cyan}}$NN $wlan"
    else
        DT=$(develsh -c "qdbus --system com.nokia.csd.CSNet /com/nokia/csd/csnet com.nokia.csd.CSNet.RadioAccess.DataTechnology")
        case $DT in
        "GPRS") echo -n "{{yellow}}$NN $gprs" ;;
        "EGPRS") echo -n "{{yellow}}$NN $egprs" ;;
        "UMTS") echo -n "{{yellow}}$NN $umts" ;;
        "HSPA") echo -n "{{yellow}}$NN $hspa" ;;
        esac
    fi
fi



All times are GMT. The time now is 15:29.

vBulletin® Version 3.8.8