The Following 5 Users Say Thank You to EmaNymton For This Useful Post: | ||
|
2012-12-31
, 13:10
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#402
|
#!/bin/sh # Get GPRS transmission tx=$(gconftool -g /cellui/settings/datacounter/transfer/gprs_home_tx_bytes) rx=$(gconftool -g /cellui/settings/datacounter/transfer/gprs_home_rx_bytes) txMB=$(($tx/1000000)) rxMB=$(($rx/1000000)) echo "up: $txMB MB, down: $rxMB MB"
#!/bin/sh # Get total GPRS transmission in MB 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)/1000000)) echo "Data used = $total MB"
#!/bin/sh # Warn in red if data left <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) amount=`dc $total $usage / p` if [ $(echo "$amount > 0.800" |bc) -eq 1 ] then echo {{red}}"Data left < 20%" fi exit 1
|
2013-01-03
, 17:36
|
|
Posts: 1,391 |
Thanked: 4,272 times |
Joined on Sep 2007
@ Vienna, Austria
|
#404
|
Any way to set custom fonts for BillBoard text? Any css file to edit manually?
gconftool -s -t string /apps/billboard/font "Comic Sans MS"
|
2013-01-03
, 17:43
|
|
Posts: 1,391 |
Thanked: 4,272 times |
Joined on Sep 2007
@ Vienna, Austria
|
#405
|
|
2013-01-03
, 20:38
|
Posts: 87 |
Thanked: 14 times |
Joined on Jan 2012
|
#406
|
#!/bin/sh # Warn in red if data left <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) amount=`dc $total $usage / p` consumed=$((total/1000000)) reply= (echo "$amount > 0.800" |bc) if [ $(reply) -eq 1 ] then echo {{red}}"$consumed MB" else echo {{cyan}}"$consumed MB" fi exit 1
The Following User Says Thank You to herno24 For This Useful Post: | ||
|
2013-01-03
, 21:43
|
|
Posts: 1,391 |
Thanked: 4,272 times |
Joined on Sep 2007
@ Vienna, Austria
|
#407
|
I modified the last thedead1440's script to display the amount of MB consumed in red if they reach 80% of total MB or else in cyan if this value is not reached.
echo M{aem,eeG}o
echo "M{aem,eeG}o"
echo "{{red}}$consumed MB"
{{cyan}}{script:/path/to/my/script.sh}
|
2013-01-03
, 21:45
|
Posts: 443 |
Thanked: 282 times |
Joined on Oct 2011
@ Grenoble, France
|
#408
|
I modified the last thedead1440's script to display the amount of MB consumed in red if they reach 80% of total MB or else in cyan if this value is not reached. I don't know how to program in this language so what I did must be very ugly haha, but is it correct?. Thanks!.
Code:#!/bin/sh # Warn in red if data left <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) amount=`dc $total $usage / p` consumed=$((total/1000000)) reply= (echo "$amount > 0.800" |bc) if [ $(reply) -eq 1 ] then echo {{red}}"$consumed MB" else echo {{cyan}}"$consumed MB" fi exit 1
|
2013-01-03
, 21:57
|
Posts: 87 |
Thanked: 14 times |
Joined on Jan 2012
|
#409
|
|
2013-01-03
, 23:35
|
Posts: 87 |
Thanked: 14 times |
Joined on Jan 2012
|
#410
|
Edit: Forgot to mention that python-gconf must be installed.
Edit2: The script could be optimized, especially the format of the shown digits depending on the values and maybe changing the string color to red, if a predefined value is going to be exceeded.
I have not much time today, but will try it tomorrow...
Last edited by EmaNymton; 2012-12-31 at 13:00.