1

Every time I turn off airplane mode on my laptop (running Debian Stretch RC with Gnome 3.22), Bluetooth gets turned on along with WiFi, even though it was off when airplane mode was activated (I have Bluetooth turned off at all times, except when I manually turn it on when I need it, which happens once a month at best).

Is there any way to prevent Bluetooth from turning on when I switch the airplane mode off?

Also, I don't want to completely disable Bluetooth-related modules or services, because I want to keep enabling Bluetooth user friendly, i.e. just click "On" in Settings menu rather than look up which services to start.

EDIT:
To be clear, I'm not asking how to disable Bluetooth at login/startup, this is already taken care of. I need it to not turn back on when I deactivate airplane mode.

2

I haven't tested this but it should work.

You could try toggling 'airplane mode' from terminal using code like this:

nmcli nm wifi off 

This should affect your wifi but not bluetooth.

See askubuntu post .

  • That works, thanks. Only in my case the command was nmcli radio wifi off. – Alexander Revo Feb 6 '17 at 14:49
  • 1
    Great! If you want a deeper integration, you could probably find where in the system code the button triggers the code and replace the default command (that includes bluetooth) with the modified command that works for you. I don't know offhand where that location is, but if you poke around you should be able to find it. – Luke Miller Feb 6 '17 at 15:21
  • Alexander, would you mind sharing how you did the deep integration? I am interested in doing the same – Alex Mar 31 at 16:59
  • 1
    @Alex , sorry, I didn’t see your comment until now, and I’m afraid I can’t help you with that because I switched to a different laptop with a different os over a year ago. – Alexander Revo May 21 at 12:33
2

You could try the following:

Edit /etc/rc.local then add the following towards the end of the file:

rfkill block bluetooth

rfkill - tool for enabling and disabling wireless devices

block: Disable the device corresponding to the given index. type is one of "all", "wifi", "bluetooth", "uwb", "wimax", "wwan" or "gps".

Haven't tried it myself, but it was referenced here.

  • Thanks, but this is not what I need. This only disables Bluetooth at login (which is already taken care of), but it still activates when I turn off airplane mode. – Alexander Revo Feb 6 '17 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.