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 15:20

Re: [Support thread] Billboard Standby Screen
 
maybe {song}{song!No song} aha?

slarti 2013-01-04 15:30

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by coderus (Post 1310869)
maybe {song}{song!No song} aha?

Thanks, that works. I guess something changed in the way this works with 1.7?

herno24 2013-01-04 15:32

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by coderus (Post 1310744)
i have no idea why you not using shell as well as external tools
Code:

#!/bin/sh

# Warn in red if data left <20%

# Data usage in cyan if data left not <20%

tx=$(gconftool -g /cellui/settings/datacounter/transfer/gprs_home_tx_bytes)
rx=$(gconftool -g /cellui/settings/datacounter/transfer/gprs_home_rx_bytes)
total=$(($tx+$rx))
usage=$(gconftool -g /cellui/settings/datacounter/general/gprs_home_notification_period_UI)
totalMB=$((($tx+$rx)/1000000))
amount=$(($total*100/$usage))
if [ $amount -ge 80 ]
then
echo {{red}}"Data left < 20%"
else
echo {{cyan}}"Data used = $totalMB MB"
fi


It doesn't work for me. I have 264 MB consumed of a total of 300 MB and i see "Data used = 264 MB" (in cyan). If i do: echo "$amount", it shows 0.

coderus 2013-01-04 15:51

Re: [Support thread] Billboard Standby Screen
 
checked on two N9s and it working :)

herno24 2013-01-04 16:00

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by coderus (Post 1310884)
checked on two N9s and it working :)

But echo "$amount" = 0 is correct?.

coderus 2013-01-04 16:15

Re: [Support thread] Billboard Standby Screen
 
no. something wrong with you copy/paste script :)

herno24 2013-01-04 17:04

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by coderus (Post 1310895)
no. something wrong with you copy/paste script :)

Ok, i chmod +x this script, is this correct or i need to chmod 775?.

coderus 2013-01-04 17:33

Re: [Support thread] Billboard Standby Screen
 
get my script here: https://dl.dropbox.com/u/26659227/harmattan/data.sh

herno24 2013-01-04 17:36

Re: [Support thread] Billboard Standby Screen
 
I found this: echo "$usage" = 1000,000,000. But usage is the total amount of MB that I have, right?, so usage should be 300,000,000 = 300 MB in total that i have. So I had to hardcode this part: amount = $ (($ total / (($ usage/1000) * 3))) to reach the correct result according to my total of 300 MB to consume.But, it is assumed that usage has to be the total MB to consume, right?. I don't know how to make it work without hardcoding it.

herno24 2013-01-04 17:51

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by coderus (Post 1310931)

It works in the way I described in the comment above, i had to hardcode the amount :confused:.


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

vBulletin® Version 3.8.8