I am looking for a single command that switches airplane mode on/off. Actually I want to manipulate my fn+f10 key to switch airplane mode. I tried to add custom shortcut from gnome settings but it only allows one command. I know that nmcli radio wifi off works fine but I need to enter two commands to turn it on/off. Is there a way to do it with one command


You can use rfkill:

alias airplane-toggle="rfkill list | grep -q '\byes\b' && rfkill unblock all || rfkill block all"

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.