Active Topics

 



Notices


Reply
Thread Tools
coderus's Avatar
Posts: 6,068 | Thanked: 11,244 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#441
data counters in settings - device - counters. set limit to 300.
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 

The Following User Says Thank You to coderus For This Useful Post:
Posts: 87 | Thanked: 14 times | Joined on Jan 2012
#442
Yes, now it works!!.
 
coderus's Avatar
Posts: 6,068 | Thanked: 11,244 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#443
lol, good
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#444
One more:

I modified the bluetooth status script to show the correct icon for connected or disconnected states. No icon is shown when BT is off.

Code:
#!/usr/bin/python
# Print bluetooth status icon off/disconnected/connected

import dbus

bus = dbus.SystemBus()

bluez = bus.get_object('org.bluez', '/')
adapter_path = bluez.ListAdapters(dbus_interface='org.bluez.Manager')[0]
adapter = bus.get_object('org.bluez', adapter_path)
powered = adapter.GetProperties(dbus_interface='org.bluez.Adapter')['Powered']
btstatus = bus.get_object('com.nokia.policy.pcfd', '/com/nokia/policy/bluetooth_override')
connected = btstatus.Get(dbus_interface='org.maemo.contextkit.Property')[0]

if powered:
    if 'default' in connected:
        print '<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth-active.png>>'
    else:
        print '<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth.png>>'
 

The Following 2 Users Say Thank You to slarti For This Useful Post:
Posts: 87 | Thanked: 14 times | Joined on Jan 2012
#445
Ok, for gprs i think we need a script (i don't know how to do it) to reset the counter automatically every month. What do you think about this?.
 
coderus's Avatar
Posts: 6,068 | Thanked: 11,244 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#446
can be done by Timed script
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 
coderus's Avatar
Posts: 6,068 | Thanked: 11,244 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#447
bluetooth icon shell script:
Code:
#!/bin/sh

powered=$(qdbus --system org.bluez $(qdbus --literal --system org.bluez / org.bluez.Manager.ListAdapters | sed -re "s/.*(\/org\/bluez\/[0-9]{4}\/hci0).*/\1/") org.bluez.Adapter.GetProperties $
connected=$(qdbus --system com.nokia.policy.pcfd /com/nokia/policy/bluetooth_override org.maemo.contextkit.Property.Get | sed -n 1p)
if [ "$powered" == "true" ]; then
        if [ "$connected" == "default" ]; then
                echo -n "<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth-active.png>>"
        else
                echo -n "<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth.png>>"
        fi
fi
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 

The Following User Says Thank You to coderus For This Useful Post:
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#448
Originally Posted by herno24 View Post
Ok, for gprs i think we need a script (i don't know how to do it) to reset the counter automatically every month. What do you think about this?.
Use the script with profilematic to check everyday if it's the day to reset. Not fully tested, before using it see your values with
Code:
gconftool-2 -R /cellui/settings/datacounter
and save it somewhere so you can manually recover.

Code:
#!/bin/sh
# reset the data counter on a selected reset day

reset_day="05" # change to your needs
day_of_month=$(date +"%d")
datetime=$(date +"%d.%m.%Y.%s")

if [ $reset_day = $day_of_month ]
then
gconftool -s --type string /cellui/settings/datacounter/transfer/gprs_home_tx_bytes "0"
gconftool -s --type string /cellui/settings/datacounter/transfer/gprs_home_rx_bytes "0"
gconftool -s --type string /cellui/settings/datacounter/general/gprs_home_last_reset $datetime
fi
 

The Following 2 Users Say Thank You to EmaNymton For This Useful Post:
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#449
Originally Posted by EmaNymton View Post
Use the script with profilematic to check everyday if it's the day to reset.
Or set a calendar entry that repeats once a month and use ProfileMatic's calendar rule.
 

The Following User Says Thank You to slarti For This Useful Post:
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#450
Originally Posted by slarti View Post
Or set a calendar entry that repeats once a month and use ProfileMatic's calendar rule.
thanks, didn't know that profilematic can do this, then you can trim the script to


Code:
#!/bin/sh
# reset the data counter 
datetime=$(date +"%d.%m.%Y.%s")
gconftool -s --type string /cellui/settings/datacounter/transfer/gprs_home_tx_bytes "0"
gconftool -s --type string /cellui/settings/datacounter/transfer/gprs_home_rx_bytes "0"
gconftool -s --type string /cellui/settings/datacounter/general/gprs_home_last_reset $datetime
 

The Following User Says Thank You to EmaNymton For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 07:44.