Score:0

how to prevent airplane mode from turning on when I turn off wifi?

us flag
HHH

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?)
chili555 avatar
cn flag
Airplane Mode: On and radio off and wifi off are all one and the same thing. You are asking, in effect, how can I turn my wifi off but leave it on.
chili555 avatar
cn flag
" when he turns wifi to "off" airplane mode turns "on" afterwards without user input." Entirely normal and expected. "he turns airplane mode "off" bluetooth instantaneously turns "on" " That's the only question here.
HHH avatar
us flag
HHH
@chili555 how is this normal? by the way I can have wifi and airplane mode and bluetooth all turned off siumultaneously so no this is not normal. @T Br I am running ubuntu 20.04 on hp laptop
chili555 avatar
cn flag
What you've described IS normal. What is not normal and is the only question here is why the bluetooth turns on without user input when the wireless is turned off and how to prevent it.
HHH avatar
us flag
HHH
@chili555 is there a command that toggles on/off airplane and bluetooth modes (separately, of course)? you can consider that this is what the question wants to say
Score:1
cn flag

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 
Score:0
do flag

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".

cocomac avatar
cn flag
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/1190203)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.