You are not logged in.

#1 2011-04-02 09:53:15

senior_spielbergo
Member
Registered: 2011-02-21
Posts: 29

[Solved] bluetooth hardware switch - Thinkpad T400

Hello,

I've got a Thinkpad T400 with integrated bluetooth, but I don't really use bluetooth, so I want to disable it to save battery power.

I figured out, how to disable it via laptop-mode-tools on startup, but when I use the hardware switch for Wlan and bluetooth to turn my Wlan on and off again bluetooth starts up again.
I also figured out that I can disable bluetooth via "echo 0 > /sys/devices/platform/thinkpad_acpi/bluetooth_enable".

I want to put that command in a script, that is only executed, when the bluetooth hardware is detected.

Now I'm wondering if any of you guys knows some script, like that.
I've already had a look at the udev files, but I couldn't figure out which one will do the job.
Maybe it's the wrong way and there is a lot easier solution.

Thanks in advance, any help would be appreciated,

David

Last edited by senior_spielbergo (2011-04-02 10:20:47)

Offline

#2 2011-04-02 10:04:32

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: [Solved] bluetooth hardware switch - Thinkpad T400

Can't you switch it off in the BIOS?
If possible, could be the easiest solution.

Offline

#3 2011-04-02 10:21:55

senior_spielbergo
Member
Registered: 2011-02-21
Posts: 29

Re: [Solved] bluetooth hardware switch - Thinkpad T400

Wow... Sometimes you really think too complicated.

Thanks for that idea smile I thought about everything but the BIOS.

Thanks again!

Offline

#4 2013-03-05 10:35:21

Profpatsch
Member
Registered: 2013-02-06
Posts: 22

Re: [Solved] bluetooth hardware switch - Thinkpad T400

I think it’s okay to revive this thread because the problem still exists.
I don’t want to disable BT in BIOS, because I use it. But I want it to be off on startup to save power.

InitiallyPowered and RememberPowered in /etc/bluetooth/main.conf aren’t honored by the system (bluetooth.service is enabled).

What can be done?

Offline

#5 2013-03-05 13:42:19

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [Solved] bluetooth hardware switch - Thinkpad T400

I do this for disabling Bluetooth on my X220 ThinkPad using Fn + F9.

I created the file /etc/acpi/actions/bluetooth.sh

#!/bin/bash

BT_RFKILL=$(rfkill list | grep tpacpi_bluetooth_sw | sed 's/\([0-9]\+\):.*/\1/')
BT_STATE=$(/usr/sbin/rfkill list $BT_RFKILL | grep "Soft blocked: yes")

if [ "x" == "x$BT_STATE" ]; then
	/usr/sbin/rfkill block $BT_RFKILL
else
	/usr/sbin/rfkill unblock $BT_RFKILL
fi

exit 0

And the file /etc/acpi/events/bluetoothconf

event=button/f24.*
action=/etc/acpi/actions/bluetooth.sh

Restart acpid.

# systemctl restart acpid.service

Now I press Fn + F9 to toggle bluetooth off and on.

Rfkill needs to be installed for this to work.

Last edited by David Batson (2013-03-05 13:43:37)

Offline

Board footer

Powered by FluxBB