I cannot really point out the exact reason, but a lot of GNU/Linux distributions fail to keep the last saved status of my Bluetooth device. So even if I had turned it OFF in my previous desktop session, the next time I login, it will be turned ON. This is how it is with Ubuntu, and sadly, the same issue exists in Fedora 18 as well.
Most Laptop users don’t use their Bluetooth connection, and when not used, it should be turned OFF, as it draws a reasonable amount of power when running. And turning it OFF, will also prolong your battery life too (obviously).
In Ubuntu, one can easily fix it by tweaking a configuration setting, but doing the same thing in Fedora (talking about ’18’ here), is a bit difficult. So I thought of writing a simple ‘how to’ concerning this, would come in handy for all the new users out there. For that, please follow the below steps.
First of all, we are going to need a tool called ‘rfkill’. It is a command-line based utility that lets us control various types of wireless networking devices in GNU/Linux. Ubuntu comes it installed by default, but Fedora does not.
So, open your Terminal window and enter the below command to install it.
su -c 'yum install rfkill'
Now, we are going use ‘rfkill’, and make Fedora execute it while loading the desktop session (every time) thus, disabling the ‘Bluetooth’ connection, automatically. For that, we have to create a configuration file called ‘rc.local’ and put the appropriate ‘rfkill’ command in it.
You don’t actually have to know any of these details, but I just thought a little information wouldn’t go wasted :). Anyhow …
Open your Terminal window and enter the below command to create that configuration file.
su -c 'vi /etc/rc.d/rc.local'
This will create an empty file and open it using a command-line based editor called ‘vi’.
So, once opened, type ‘i’ key on your keyboard to start entering data into the newly created, empty file (otherwise ‘vi’ will not let you enter anything). And as soon as you type ‘i’, you should see a text field called ‘— INSERT —‘ appearing at the bottom of the editor window (shown below), denoting that ‘vi’ is waiting for your input.
Now simply copy and paste (or type them manually) the below text into the editor.
rfkill block bluetooth
Now, to save and exit the ‘vi’ editor, first press the ‘Esc’ key on your keyboard. Then type ‘:wq’ (shown below) and press Enter.
As soon as you do that, ‘vi’ will save the content to the newly created ‘rc.local’ and exit.
Now in this final step, we will give executable permissions to the ‘rc.local’ file (otherwise the OS won’t be able to run it). For that, simply enter the below command.
su -c 'chmod +x /etc/rc.d/rc.local'
Well that’s it.
Now just for testing, turn Bluetooth ON and reboot the computer. And the next time you login into the Desktop, it should be turned OFF. But bear in mind that, because this command is run when you login to the desktop, it might take few seconds before the Bluetooth icon changes into the OFF status (about 2-3 seconds in my Laptop). That’s it, I hope it was helpful.