PDF download Download Article PDF download Download Article

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!

Part 1
Part 1 of 2:

Creating the Action

PDF download Download Article
  1. Copy paste this in: networksetup -listnetworkserviceorder.
  2. Then, you can close Terminal and open Automator.
    Advertisement
  3. Click on Quick Action and Choose.
  4. Double click on it.
  5. Workflow receives no input in any application.
  6. 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.
  7. 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.
  8. Advertisement
Part 2
Part 2 of 2:

Creating the Keyboard Shortcut.

PDF download Download Article
  1. At the top, click on Shortcuts.
  2. Scroll to the very bottom until you find the action that you just created.
  3. Then, click on Add Shortcut.
  4. You might use Ctrl+ Opt+ Cmd+W. Control Option Command W). Make sure the shortcut is not a common shortcut.
  5. It should work!
  6. Advertisement



Community Q&A

Search
Add New Question
  • Question
    What OS system does this work on? It doesn't seem to be working on Mojave.
    Evan Huang
    Evan Huang
    Community Answer
    This 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
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Set a Keyboard Shortcut to Open Mac AppsSet a Keyboard Shortcut to Open Mac Apps
Change the Default WiFi Network on a MacChange the Default WiFi Network on a Mac
Change the Keyboard Shortcut for a Mac ScreenshotStep-by-Step Guide on Changing the Keyboard Shortcut for a Mac Screenshot
Block a WiFi Network on PC or MacBlock a WiFi Network on PC or Mac
Set a Keyboard Shortcut to Open Spotlight Set a Keyboard Shortcut to Open Spotlight
Connect a Mac to the InternetConnect a Mac to the Internet
Zoom Out on a Mac6 Ways to Quickly Zoom Out on a Mac
Change from Ethernet to WiFi Change from Ethernet to WiFi
Restart a Mac6 Ways to Restart Your Mac: Apple Menu, Shortcuts, and More
Create a Shortcut on iPhone Create Custom Shortcuts on Your iPhone
Make a Shutdown Shortcut in Windows Create a Shutdown Shortcut on Your Windows Desktop or Taskbar
Take a Screenshot on a Mac Take a Screenshot on a Mac: Complete Beginner's Guide
Use Keyboard Shortcuts Use Keyboard Shortcuts Like a Pro: The Complete Guide
Ctrl Alt Delete Mac Ctrl Alt Delete on a Mac: Quit Apps + Check Performance
Advertisement

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 63,215 times.
How helpful is this?
Co-authors: 7
Updated: February 24, 2025
Views: 63,215
Categories: Computer Keyboards | Mac
Thanks to all authors for creating a page that has been read 63,215 times.

Is this article up to date?

Advertisement