3

When I turn off wifi on ubuntu 20.04, the airplane mode turns on, and when I turn it off, the bluetooth turns on, is this a bug or what? I also had same behaviour in 18.04

I want to have the behaviour of turning on/off only the corresponding option which I have selected, how can I fix this? (I can accept a method that programmatically turns on/off any of these three and prevents the other two from toggling)

for example the command nmcli radio wifi off turns off wifi, but this will cause airplane mode to turn on, I am thinking of a solution where I create a script and place these commands in order, and then add this script to the classpath to call it from the terminal:

    nmcli radio wifi on
turn off airplane mode command (how to do this?)

turn off bluetooth command (how to do this?)

HHH
  • 33
  • 4

2 Answers2

1

Please run the command:

rfkill list all

You will see something like this:

0: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
48: hci0: Bluetooth
Soft blocked: no
Hard blocked: no

Take note of the device identifier values; in this case, 0, 1 and 48.

Toggle the bluetooth off:

sudo rfkill block 48

And on:

sudo rfkill unblock 48

Toggle the wireless off:

sudo rfkill block 1

Check:

rfkill list all

You will see something like this, depending on the make and model of your laptop:

 0: tpacpi_bluetooth_sw: Bluetooth
 soft blocked: no
 Hard blocked: no
 1: phy0: Wireless LAN
 Soft blocked: yes
 Hard blocked: no
 48: hci0: Bluetooth
 Soft blocked: no
 Hard blocked: no

The wireless is soft(ware) blocked. It will be hard(ware) blocked by the wireless switch or key combination on your laptop. The rfkill command cannot move the switch!

Toggle the wireless on:

sudo rfkill unblock 1 
chili555
  • 61,330
1

I've written an extension which gives you control over what to activate when turning off airplane mode. With it you can at least suppress the "Bluetooth turning on when I disable airplane mode" behavior. You can get it from GitHub or from the GNOME Extensions website. It's called "Sane Airplane Mode".

Kippi
  • 157