I have an HP Spectre x360 convertible laptop and I'm running Ubuntu 18.04. Every time I turn the screen sideways or in tablet mode and back, 'Airplane Mode' is activated. In fact, when I boot up and login, I have to manually turn off 'Airplane Mode' and turn wifi back on. I don't want to disable the gnome rfkill plugin like so: 'gsettings set org.gnome.settings-daemon.plugins.rfkill active false' because then I can no longer use bluetooth. Also, for some godforsaken reason, even when I DO disable the plugin, the gnome shell turns on 'Airplane Mode' anyway, which means that I have to go turn wifi back on EVERY time I log in. This is so annoying, I really liked where 18.04 was going but this is seriously breaking the whole gnome shell experience.
My new HP computer also had some problems with wi-fi under Ubuntu. Slightly different model and problems, and I managed to fix the most of them, though.
I'm using an HP 15-bs048ns. Maybe you can try these methods, ordered by increasing desperation ‒ hope it helps.
(Please excuse me if you already tried some of them or they're really obvious. I don't know how knowledgeable are you at Linux, and it could help other users out there. I'll try to add links to related answers and pages, too.)
Try not holding the Fn key
You probably have already tried this, but, is your airplane key Fn + F12 or just F12? Some laptops, by default, require that you hold Fn for the F1...F12 keys and not for the special keys.
In my laptop, F12 is airplane, and Fn+F12 is F12. You can set your Fn key to work the traditional way from the BIOS, though. (F12 = F12, Fn+F12 = airplane)
(No matter what the setting, modifier keys work normally with function keys: Shift+F10 will never press the Play/Pause key.)
Airplane key won't work in a GUI - try from the text console
I have an airplane key in F12, but for some reason, it doesn't work under X or Wayland. But it works from the text console (TTY)
If I want to use the Airplane key, I need to:
- Press Ctrl+Alt+F3 (no need to worry for the Fn key).
- Type my username and password
- Press the Airplane key
- Press Ctrl+Alt+F2 to return to the GUI.
If my keyboard shortcuts to move between the TTY and the GUI don't work, just try different function keys (F1, F2... through F7)
Install a different module for your wi-fi
My computer didn't even have drivers for my wireless. Yours appears to, but they might not be working properly.
If you need to install new drivers, you'll need first to disable the Secure Boot in shim:
sudo mokutil --disable-validation
It will ask you for a one-time password. Don't bother using a good one, it only works until the next reboot.
You reboot, and when you encounter a blue screen reading “Press any KEY to perform MOK management”, press a key and follow the instructions. You'll probably need to type three separate characters from the password, suppose you used
abcdefgh as password:
Type character 4 of password: d Type character 8 of password: h Type character 1 of password: a
Press Enter after every letter. Yes, these instructions look too detailed, but it's pretty common to screw up the first time (I did).
I don't know where you can find better modules for your computer. Mine works with lwfinger's drivers (my problems were only with the wi-fi; you'll probably need modules for both bluetooth and wifi).
In any case, if you find your module, it needs to be recompiled every time you upgrade the kernel (or else, the wireless interface and the wireless menus at Ubuntu disappear on your next boot.). You can set up DKMS to recompile them automatically every kernel upgrade ‒ I'm still testing this so I can't give you detailed instructions.
Reprogram your keyboard
I read somewhere (I'll link it if I find it) I could use the
showkey command under the TTY to read key events straight from the kernel. And
showkey -s to find the address of the pressed key.
Looking at the showkey man page, it doesn't directly read them from the kernel anymore, and the airplane key doesn't output any key event for me... even though it clearly works.
But my computer manages its wireless differently (I'm not sure I even have a hard lock), so it might work for you. If it sends some key event, you can reprogram the key to a different function ― maybe it will work.
You can read at the answer NicoTho that posted how to reprogram a key.