How to enable Wifi toggle key (f12)?

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


.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I run Ubuntu 18.04 on my HP, and before dual booting, when I only had Windows, I would always press the F12 key to turn the Wifi on and off easily. Now that is the only key that doesn't work on Ubuntu.



I've already tried bash scripts and keyboard settings, to no avail. At most, I managed to get messages to show up, but the wifi stayed the same. (also, the settings won't let me set F12 alone, so I set Ctrl+F12; though right now that's the least of my concerns)



Until now, I have this:



#!/bin/sh

if [ $(nmcli nm wifi | awk '/led/ print') = 'enabled' ] ; then
nmcli nm wifi off
# notify-send -i network-wireless-none "Wireless" "Wireless disabled"
echo 'wifi off'
else
nmcli nm wifi on
notify-send -i network-wireless-none "Wireless" "Wireless enabled"
echo 'wifi on'
fi


What could be wrong?







share|improve this question



























    up vote
    1
    down vote

    favorite












    I run Ubuntu 18.04 on my HP, and before dual booting, when I only had Windows, I would always press the F12 key to turn the Wifi on and off easily. Now that is the only key that doesn't work on Ubuntu.



    I've already tried bash scripts and keyboard settings, to no avail. At most, I managed to get messages to show up, but the wifi stayed the same. (also, the settings won't let me set F12 alone, so I set Ctrl+F12; though right now that's the least of my concerns)



    Until now, I have this:



    #!/bin/sh

    if [ $(nmcli nm wifi | awk '/led/ print') = 'enabled' ] ; then
    nmcli nm wifi off
    # notify-send -i network-wireless-none "Wireless" "Wireless disabled"
    echo 'wifi off'
    else
    nmcli nm wifi on
    notify-send -i network-wireless-none "Wireless" "Wireless enabled"
    echo 'wifi on'
    fi


    What could be wrong?







    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I run Ubuntu 18.04 on my HP, and before dual booting, when I only had Windows, I would always press the F12 key to turn the Wifi on and off easily. Now that is the only key that doesn't work on Ubuntu.



      I've already tried bash scripts and keyboard settings, to no avail. At most, I managed to get messages to show up, but the wifi stayed the same. (also, the settings won't let me set F12 alone, so I set Ctrl+F12; though right now that's the least of my concerns)



      Until now, I have this:



      #!/bin/sh

      if [ $(nmcli nm wifi | awk '/led/ print') = 'enabled' ] ; then
      nmcli nm wifi off
      # notify-send -i network-wireless-none "Wireless" "Wireless disabled"
      echo 'wifi off'
      else
      nmcli nm wifi on
      notify-send -i network-wireless-none "Wireless" "Wireless enabled"
      echo 'wifi on'
      fi


      What could be wrong?







      share|improve this question













      I run Ubuntu 18.04 on my HP, and before dual booting, when I only had Windows, I would always press the F12 key to turn the Wifi on and off easily. Now that is the only key that doesn't work on Ubuntu.



      I've already tried bash scripts and keyboard settings, to no avail. At most, I managed to get messages to show up, but the wifi stayed the same. (also, the settings won't let me set F12 alone, so I set Ctrl+F12; though right now that's the least of my concerns)



      Until now, I have this:



      #!/bin/sh

      if [ $(nmcli nm wifi | awk '/led/ print') = 'enabled' ] ; then
      nmcli nm wifi off
      # notify-send -i network-wireless-none "Wireless" "Wireless disabled"
      echo 'wifi off'
      else
      nmcli nm wifi on
      notify-send -i network-wireless-none "Wireless" "Wireless enabled"
      echo 'wifi on'
      fi


      What could be wrong?









      share|improve this question












      share|improve this question




      share|improve this question








      edited 2 days ago









      Graham

      1,76161323




      1,76161323









      asked 2 days ago









      aaaaa

      65




      65

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          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: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2faskubuntu.com%2fquestions%2f1062049%2fhow-to-enable-wifi-toggle-key-f12%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1062049%2fhow-to-enable-wifi-toggle-key-f12%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491