Do you find it annoying to have to navigate to the WiFi icon every time you want to turn off the WiFi on your Mac? Fortunately, there's an easier way. By setting up a keyboard shortcut, you can turn your Mac's WiFi on and off by pressing just one key!
Steps
-
Open Terminal. Copy paste this in: networksetup -listnetworkserviceorder .
-
Remember the number that shows the WiFi. Then, you can close Terminal and open Automator.Advertisement
-
Choose a type for your document. Click on Quick Action and Choose .
-
Search for run shell script in the search bar on the left. Double click on it.
-
Make sure the top section is correct on the right: Workflow receives no input in any application .
-
Copy and paste the following script into the section of “Run Shell Script,” substituting “X” with any number that you found the WiFi port to be earlier. The script is: networksetup -getairportpower enX | grep "On" && networksetup -setairportpower enX off || networksetup -setairportpower enX on.
-
Click on Run in the top right corner. See if your WiFi turns off. You might need to wait a few seconds. If it works, click on the X and save the action, and name it something obvious like “WiFi Toggle.” Then, proceed to the next section.
Advertisement
-
Open System Preferences > Keyboard . At the top, click on Shortcuts .
-
Click on Services . Scroll to the very bottom until you find the action that you just created.
-
Click on the None to the right of the name. Then, click on Add Shortcut .
-
Type in your shortcut. You might use Ctrl + ⌥ Opt + ⌘ Cmd + W . Control Option Command W). Make sure the shortcut is not a common shortcut.
-
Test your shortcut. It should work!
Advertisement
Community Q&A
Search
-
QuestionWhat OS system does this work on? It doesn't seem to be working on Mojave.Evan HuangCommunity AnswerThis should be working on Mojave. I tested it and it worked. Copy paste the code you entered into the section Run Shell Script.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Tips
Submit a Tip
All tip submissions are carefully reviewed before being published
Thanks for submitting a tip for review!
About This Article
Thanks to all authors for creating a page that has been read 55,735 times.
Advertisement