Re: [Question] Disconnect Internet during nights
for people that are interested with this, I have made a couple of Hildon shortcuts to trigger the script on demand.
I have both a schedule and the icons on the desktop to activate power saver and it works pretty good :)
here are the shortcuts that you can add to the desktop:
create a file (power-saver-ON.desktop) under /usr/share/applications/hildon:
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=PowerSaverON
Exec=/usr/local/bin/power-saver.sh
Icon=gps_not_connected
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
and another one to turn off Power Saver (connects to available APN
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=PowerSaverOFF
Exec=/usr/local/bin/power-saver.sh off
Icon=gps_location
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
this requires the power-saver.sh script to be located under /usr/local/bin
Code:
#!/bin/sh
if [ "$1" == "off" ]
then
echo "Restoring power suckers..."
gconftool-2 --set --type list --list-type string /system/osso/connectivity/network_type/auto_connect[*]
gconftool-2 --set --type bool /apps/modest/auto_update true
#run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:0
else
echo "Going into power saving mode..."
gconftool-2 --set --type list --list-type string /system/osso/connectivity/network_type/auto_connect []
gconftool-2 --set --type bool /apps/modest/auto_update false
run-standalone.sh dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true
#run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1
fi
thanks to evad for the script !
|