| The Following 3 Users Say Thank You to thp For This Useful Post: | ||
|
|
2013-01-25
, 22:05
|
|
|
Community Council |
Posts: 664 |
Thanked: 1,648 times |
Joined on Apr 2012
@ Hamburg
|
#552
|
|
|
2013-01-26
, 13:10
|
|
Posts: 4 |
Thanked: 0 times |
Joined on Jun 2012
|
#553
|
BUT, when I changed the title of my alarm "Herätys" to "Heratys" it magically showed up in Billboard, too!
So, it seems that Billboard can't show scandinavian letters.
edit: It doesn't show scandinavian letters from scripts. They show up just fine if I write them directly to the input field in Billboard. Should the output from the script be encoded somehow?
|
|
2013-01-27
, 09:18
|
|
|
Posts: 1,390 |
Thanked: 4,262 times |
Joined on Sep 2007
@ Vienna, Austria
|
#554
|
|
|
2013-01-27
, 09:27
|
|
Moderator |
Posts: 6,215 |
Thanked: 6,402 times |
Joined on Nov 2011
|
#555
|
since I suck so bad at coding, I couldn't get it to work. How is it correctly incorporated into this script?
Anybody up for a data network signal-% script?
Thanks so much.
#!/bin/sh
percent=$(qdbus --system com.nokia.csd /com/nokia/csd/csnet com.nokia.csd.CSNet.SignalStrength.SignalPercent)
if [[ $percent -ge 25 ]]
then
echo -n "{{yellow}} $percent % " "{{=$(($percent/100)).$((($percent%100)/10))$(($percent%10))}}"
else if [[ $percent -le 24 ]]
then
echo -n "{{red}} $percent % " "{{=$(($percent/100)).$((($percent%100)/10))$(($percent%10))}}"
fi
fi
| The Following User Says Thank You to thedead1440 For This Useful Post: | ||
|
|
2013-01-27
, 10:17
|
|
|
Posts: 6,431 |
Thanked: 12,683 times |
Joined on Nov 2011
@ Open Mobile Platform, Innopolis, Russia
|
#556
|
$percent % " "{{=$(($percent/100)).$((($percent%100)/10))$(($percent%10))}}
$percent % " "{{=$(($percent/100)).$((($percent%100)/10))$(($percent%10))}}
$percent % " "{{=$(($percent/100)).$((($percent%100)/10))$(($percent%10))}}
$percent % " "{{=$(($percent/100)).$((($percent%100)/10))$(($percent%10))}}
|
|
2013-01-27
, 10:35
|
|
Moderator |
Posts: 6,215 |
Thanked: 6,402 times |
Joined on Nov 2011
|
#557
|
| The Following User Says Thank You to thedead1440 For This Useful Post: | ||
|
|
2013-01-27
, 11:10
|
|
|
Community Council |
Posts: 664 |
Thanked: 1,648 times |
Joined on Apr 2012
@ Hamburg
|
#558
|
thp meant to tell you that in place of PERCENT use your variable which is $percent in this case; simples and 0 coding knowledge required
|
|
2013-01-27
, 11:28
|
|
|
Community Council |
Posts: 664 |
Thanked: 1,648 times |
Joined on Apr 2012
@ Hamburg
|
#560
|
#!/usr/bin/python
# Show Device Uptime in decimal days
sc = u"\u2622"
seconds = int(float(open('/proc/uptime').read().split()[0]))
print 'up: '+("%.1f" % (float(seconds)/float(60*60*24))).replace('.', ',')+' d'+' '+sc.encode('utf-8')
Assuming you don't have a shell that can calculate in floating point, a better solution would be would be:
echo "{{=$((PERCENT/100)).$(((PERCENT%100)/10))$((PERCENT%10))}}"
This will work for all positive integers.