A command to switch airplane mode in gnome?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












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










share|improve this question



























    up vote
    1
    down vote

    favorite
    1












    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










    share|improve this question

























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      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










      share|improve this question















      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







      wifi gnome nmcli






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 11 '17 at 6:30









      jasonwryan

      47.1k14127178




      47.1k14127178










      asked Oct 9 '17 at 18:58









      Bbbbbb kkkkkkk

      82




      82




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          You can use rfkill:



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





          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397098%2fa-command-to-switch-airplane-mode-in-gnome%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            You can use rfkill:



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





            share|improve this answer
























              up vote
              3
              down vote



              accepted










              You can use rfkill:



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





              share|improve this answer






















                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                You can use rfkill:



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





                share|improve this answer












                You can use rfkill:



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






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 9 '17 at 19:50









                jayhendren

                5,13221341




                5,13221341



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397098%2fa-command-to-switch-airplane-mode-in-gnome%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?