Home » Featured, Hacks

[How-To] Save up battery by taking down WiFi

3 February 2012Entry by

If you’re interested in saving up battery, here’s a little how-to on adding a desktop-cmd-exec button that will enable/disable WiFi completely upon being pressed.

First, get desktop command execution widget, if you don’t have it already:

sudo gainroot

apt-get install desktop-cmd-exec

Next you would want to get an enable/disable script. For your convenience, I’ve uploaded it to Pastebin: http://pastebin.com/3ZHx11GZ

Copy the script and save it as wifi.sh in your home directory. Make it executable:

chmod +x wifi.sh

Now, to add the button. Switch to a desktop where you wish to place it, go to edit mode (long tap on the screen or tap on an empty space and tap the gear button that appears on top). Add Desktop Command Execution Widget from the menu, and click the wrench on the widget that appeared. Select the “Add cmd” option on the right. Name the command “Enable/Disable WiFi” or however you’d like, in command put this:

echo “/home/user/wifi.sh” | sudo gainroot | echo “”

Add the command, you’ll be kicked back to the edit mode, so press the wrench again. You’ll see that the new command was already chosen (if it is not, chose it), so you need just to adjust a few options, check the “Update on click” option and uncheck “Update on boot” and “Update on desktop change” buttons. Ta-da! Now you have a button to completely disable the WiFi when you don’t need it and enable it on need, which will save up quite some battery charge.


Of course, you can utilize the script otherwise, like adding an Alarmed job to disable/enable wifi on certain times.


Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.