The Following User Says Thank You to Matan For This Useful Post: | ||
![]() |
2010-01-21
, 03:04
|
|
Posts: 139 |
Thanked: 135 times |
Joined on Jan 2010
@ Cambridgeshire, UK
|
#32
|
![]() |
2010-01-21
, 03:39
|
Posts: 318 |
Thanked: 49 times |
Joined on Nov 2009
|
#33
|
![]() |
2010-01-21
, 19:27
|
Posts: 1,224 |
Thanked: 1,763 times |
Joined on Jul 2007
|
#34
|
The Following User Says Thank You to Matan For This Useful Post: | ||
![]() |
2010-01-21
, 19:36
|
Posts: 518 |
Thanked: 160 times |
Joined on Dec 2009
|
#35
|
I do not want to manually connect to the internet, I want it to automatically connect when widgets/apps request data at their intervals, once data transfers have been done I want it to disconnect the gprs connection. That would improve battery life since I noticed that just leaving the gprs connection running all day drains the battery faster even when not in use.
![]() |
2010-01-21
, 22:14
|
|
Posts: 139 |
Thanked: 135 times |
Joined on Jan 2010
@ Cambridgeshire, UK
|
#36
|
![]() |
2010-01-21
, 22:17
|
Posts: 1,224 |
Thanked: 1,763 times |
Joined on Jul 2007
|
#37
|
The Following 2 Users Say Thank You to Matan For This Useful Post: | ||
![]() |
2010-01-22
, 10:14
|
Posts: 41 |
Thanked: 15 times |
Joined on Jan 2010
@ Finland, Aaland Islands
|
#38
|
![]() |
2010-01-22
, 17:15
|
|
Posts: 139 |
Thanked: 135 times |
Joined on Jan 2010
@ Cambridgeshire, UK
|
#39
|
This is an interesting idea, I hate to forgetting turning wifi off before going to bed and find my phone dead in the morning.
Installed script and it works fairly good for 3G.
Seems like wlan keeps sending packets although the device is idle.
A more accurate way to turn connections off would be to check for user inactivity but I have no idea how to check that via a shell script.
![]() |
2010-01-22
, 17:21
|
|
Posts: 4,274 |
Thanked: 5,358 times |
Joined on Sep 2007
@ Looking at y'all and sighing
|
#40
|
Also, does anyone know if there's a way to send a notification message from a script? I'm talking about the notifications which confirm an SMS delivery or a website's security or "code accepted" when you unlock - the pop up ones which fade & slide away automatically.
run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Message goes here"
The Following 6 Users Say Thank You to qwerty12 For This Useful Post: | ||
![]() |
|
chmod a+x /usr/local/bin/scriptname
First, you should run it to see if it does what you want.
If you are sure you want it to start at boot time, the easiest way is probably to create a file /etc/event.d/autodisconnect, containing:
It can be up to 10 minutes, if last transfer happens a few seconds after the sleep starts, because the next check will see this transfer.
I believe using received makes more sense, since sometime the network appears up, but the other side is not there. In that case applications might continually send data, but nothing will be received.
I don't know of a wiki explaining all this, but you seem to be on the right track for understanding. I can think of no better way to do it than looking at simple scripts, and playing with them. If you don't have a Linux desktop, search for "manual page" of each command you need to learn.