Wednesday, February 9, 2011

Turning off Bluetooth by Default in Ubuntu

The Ubuntu 10.10 install on my new laptop turns on the Bluetooth adapter by default, which is a minor battery drain. Since I rarely (if ever) use any Bluetooth devices, I'd rather turn off the adapter by default. Unfortunately, this is not as simple as changing an option in the Bluetooth panel application and requires some minor command-line tweakage.

Per this helpful post on the Ubuntu forums, I just had to edit the file '/etc/init.d/rc.local':
sudo vim /etc/init.d/rc.local
And add the following line:
rfkill block bluetooth
Although the post suggests putting the line at the end of rc.local, that didn't seem to work for me. So I added it near the beginning and all is well. Now, after booting up and logging in, the Bluetooth panel icon is happily grayed-out to show that the adapter is deactivated.

1 comment:

  1. you should have paid a little more attention to the post you linked:
    * you should edit /etc/rc.local , not /etc/init.d/rc.local
    * the post clearly states that you have to add that line before the last line (i.e. exit 0)

    also, it is good practice to use _sudoedit_ instead of _sudo vim_ (to prevent doing things as root accidentally that you did not really intend).

    anyway, thanks for the tip :)

    ReplyDelete