How to Turn Off Bluetooth on Linux

Got this tip from some posts in Ubuntuforums.

Linux bluez stack has no way to turn off Bluetooth device via GUI. Normally we (at least, me) use Bluetooth for file transfer few times a day for very short period. Keeping Bluetooth enable wastes the extremely-precious laptop battery.

The solution is to create this shell script on your desktop. You can choose any name, meaningful or not. My script is called "bttoggle".

#!/bin/bash
if ps -A | grep -c bluetoothd
then
gksudo /etc/init.d/bluetooth stop
else
gksudo /etc/init.d/bluetooth start
fi

Give it executable permission and proper icon. Bluetooth icon in normal Ubuntu desktop should be available at:

/usr/share/icons/hicolor/48x48/apps/bluetooth.png

bttoggle

When you need Bluetooth, double click on bttoggle, choose Run and give your password.

Don't forget to set Bluetooth icon on GNOME panel to "Only display when adapter present" in Preferences > General so you can recognize the status of Bluetooth.

Comments

use blueman!

thnx MK :)

Add new comment