I'm on Ubuntu 18.04.1 Bionic Beaver using an HP Pavilion laptop. My laptop has a key for toggling airplane mode. Using xev, I found out that it has keycode 255. I've saved the following code at /bin/airplane_mode and set it as executable:
#!/bin/bash
if [ "$(nmcli r wifi)" = "enabled" ]
then nmcli r wifi off
else nmcli r wifi on
fiNow, how can I set it up such that this file is run whenever I press that key? Any help would be appreciated.
2 Reset to default