Active Topics

 



Notices


Reply
Thread Tools
Win7Mac's Avatar
Community Council | Posts: 664 | Thanked: 1,648 times | Joined on Apr 2012 @ Hamburg
#721
This script.
I want the {cell-signal-strength} inline with signal bar and have it the same color.
Thanks.
__________________
Nokia 5110 > 3310 > 6230 > N70 > N9 BLACK 64GB
Hildon Foundation Board member
Maemo Community e.V. co-creator, founder and director since Q4/2016
Current Maemo Community Council member
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#722
Originally Posted by Win7Mac View Post
This script.
I want the {cell-signal-strength} inline with signal bar and have it the same color.
Thanks.
Ok, you shouldn't put the tag in to the script but you should call the script with it.

{cell-signal-strength?{script: sh signalbar.sh}}

This ties the execution of the script to changes in the property.

The $percent variable in your script has the exact same value as the {cell-signal-strentgh} property at that time, so use that.

P.S.

The image produced by my previous image tag is just for signal strength in bars (0 bars for no signal and 5 bars for max). Just like on the normal status bar.

Last edited by slarti; 2013-03-21 at 12:53.
 

The Following User Says Thank You to slarti For This Useful Post:
Win7Mac's Avatar
Community Council | Posts: 664 | Thanked: 1,648 times | Joined on Apr 2012 @ Hamburg
#723
Originally Posted by slarti View Post
Ok, you shouldn't put the tag in to the script but you should call the script with it.
{cell-signal-strength?{script: sh signalbar.sh}}
This ties the execution of the script to changes in the property.
The $percent variable in your script has the exact same value as the {cell-signal-strentgh} property at that time, so use that.
This works partial. I can't get the " %" after $percent to show up and when I switch on flightmode it breaks the script and nothing is shown except "}".

Here's my actual script:
Code:
#!/bin/sh

percent=$(qdbus --system com.nokia.csd /com/nokia/csd/csnet com.nokia.csd.CSNet.SignalStrength.SignalPercent)
if [[ $percent -eq -1 ]]
then echo -n "{{red}}Flugmodus an ✈"
else if [[ $percent -ge 20 ]]
then printf "{{yellow}}{{=$(($percent/100)).$((($percent%100)/10))$(($percent%10))}} $percent %"
else if [[ $percent -le 19 ]]
then printf "{{red}}{{=$(($percent/100)).$((($percent%100)/10))$(($percent%10))}} $percent %"
fi
fi
fi
__________________
Nokia 5110 > 3310 > 6230 > N70 > N9 BLACK 64GB
Hildon Foundation Board member
Maemo Community e.V. co-creator, founder and director since Q4/2016
Current Maemo Community Council member
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#724
Originally Posted by Win7Mac View Post
This works partial. I can't get the " %" after $percent to show up ...
Use echo instead of printf, or use %% with printf to get a single "%".

Originally Posted by Win7Mac View Post
...and when I switch on flightmode it breaks the script and nothing is shown except "}".
This works for me. I have no idea why it doesn't for you.

That's because the {cell-signal-strength} property isn't there when in Flightmode.

To correct it:

{cell-signal-strength?{script: sh signalbar.sh}}{{red}}{cell-signal-strength!Flugmodus an ✈}

You can drop the -1 evaluation from your script, too, if you want.



In case somebody who knows missed this:

Does anyone know how to get the current cellular radio mode (2g or 3g)?

Last edited by slarti; 2013-03-21 at 21:23. Reason: found the reason
 

The Following User Says Thank You to slarti For This Useful Post:
Posts: 3 | Thanked: 0 times | Joined on Aug 2012
#725
How do I use differents size texts and font?

I mean like this guy here: https://www.dropbox.com/s/0zrh0zif90...0321141328.png

Last edited by Scarback; 2013-03-22 at 11:40.
 
Posts: 3 | Thanked: 0 times | Joined on Aug 2012
#726
Originally Posted by Scarback View Post
How do I use differents size texts and font?
I mean, like this guy here: https://www.dropbox.com/s/0zrh0zif90...0321141328.png
 
Win7Mac's Avatar
Community Council | Posts: 664 | Thanked: 1,648 times | Joined on Apr 2012 @ Hamburg
#727
Originally Posted by Scarback View Post
How do I use differents size texts and font?
I mean like this guy here: https://www.dropbox.com/s/0zrh0zif90...0321141328.png
Not (yet) possible. That guy uses 1 text size (normal) and 1 font (Pure), nothing mixed.


Originally Posted by slarti View Post
That's because the {cell-signal-strength} property isn't there when in Flightmode.
To correct it:
{cell-signal-strength?{script: sh signalbar.sh}}{{red}}{cell-signal-strength!Flugmodus an ✈}
You can drop the -1 evaluation from your script, too, if you want.
This works, but I still have that nasty "}" in white (default in BB) before "Flugmodus an ✈".
I also dropped the -1 evaluation from the script, too.
I quadro-checked for syntax errors, but there aren't; every opening bracket has a closing bracket. Very strange.
But when I run the script from terminal the output is fine with flightmode ON and OFF.

EDIT: Did some further testing and when I edit this line
Code:
{cell-signal-strength?{script: sh signalbar.sh}}{{red}}{cell-signal-strength!Flugmodus an ✈}
to
Code:
{cell-signal-strength?script: sh signalbar.sh}}{{red}}{cell-signal-strength!Flugmodus an ✈}
the outcome is fine when in flightmode, but the script does not get called when NOT in flightmode.
Seems to me Billboard has a problem here. Any ideas?
__________________
Nokia 5110 > 3310 > 6230 > N70 > N9 BLACK 64GB
Hildon Foundation Board member
Maemo Community e.V. co-creator, founder and director since Q4/2016
Current Maemo Community Council member

Last edited by Win7Mac; 2013-03-22 at 14:44. Reason: added info
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,700 times | Joined on Nov 2011 @ Ängelholm, Sweden
#728
what about {meecast-icon}
is it broken in current build?
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 3 Users Say Thank You to coderus For This Useful Post:
Posts: 239 | Thanked: 70 times | Joined on Oct 2010 @ Germany
#729
Originally Posted by coderus View Post
what about {meecast-icon}
is it broken in current build?
looks like... doesn't work for me too... but i need help anyway... but i'm in a hurry so i'll ask later
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#730
Originally Posted by Win7Mac View Post
Not (yet) possible. That guy uses 1 text size (normal) and 1 font (Pure), nothing mixed.




This works, but I still have that nasty "}" in white (default in BB) before "Flugmodus an ✈".
I also dropped the -1 evaluation from the script, too.
I quadro-checked for syntax errors, but there aren't; every opening bracket has a closing bracket. Very strange.
But when I run the script from terminal the output is fine with flightmode ON and OFF.

EDIT: Did some further testing and when I edit this line
Code:
{cell-signal-strength?{script: sh signalbar.sh}}{{red}}{cell-signal-strength!Flugmodus an ✈}
to
Code:
{cell-signal-strength?script: sh signalbar.sh}}{{red}}{cell-signal-strength!Flugmodus an ✈}
the outcome is fine when in flightmode, but the script does not get called when NOT in flightmode.
Seems to me Billboard has a problem here. Any ideas?
Now I really have no idea why the extra bracket is there.

I do see why the script doesn't get called when not in flight mode with the latter line but I think you do, too. Did you check the script output for syntax errors? Maybe try it the other way around?

{{red}}{cell-signal-strength!Flugmodus an ✈}{cell-signal-strength?{script: sh signalbar.sh}}

Edit:

This will work:

{{red}}{cell-signal-strength!Flugmodus an ✈}{cell-signal-strength?{script: sh signalbar.sh}

Although, I think this is a bug. IMO every opening bracket should have a closing bracket.

Originally Posted by slarti View Post
Does anyone know how to get the current cellular radio mode (2g or 3g)?
I'll answer this myself.

Code:
~ $ develsh
~ $ qdbus --system com.nokia.csd.CSNet /com/nokia/csd/csnet com.nokia.csd.CSNet.RadioAccess.Technology

Last edited by slarti; 2013-03-22 at 21:23.
 

The Following 2 Users Say Thank You to slarti For This Useful Post:
Reply


 
Forum Jump


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