Skip to content

Switch the display configuration for your 2 monitors on a Mac

Notifications You must be signed in to change notification settings

SatelliteWP/switch-monitors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Switch Monitors for Mac

You have a docking station for your mac and 2 monitors. For some reason, your display configuration often switches your monitor order.

Not anymore!

Requirements

First, you need to install Homebrew.

Once done, you need to install DisplayPlacer:

brew install displayplacer

And PHP:

brew install php

Installation

To install this script, simply go to Library folder and clone this repository:

cd /Library
sudo git clone https://github.com/SatelliteWP/switch-monitors.git
sudo chmod +x /Library/switch-monitors/run.sh

That's it! The installation is completed.

You can call the monitor switching by calling the script from the terminal:

/Library/switch-monitors/run.sh

Mapping to a key

It is faster to use the script by mapping it to a key on your keyboard, for instance, using F19.

To do so, open Automator.

Create a new "Quick Action" script. Pick "Run AppleScript" and paste the following code :

on run {input, parameters}
     do shell script "/Library/switch-monitors/run.sh"
     return input
end run

Make sure to select : Workflow receives Automatic (Nothing) in any application. Leave other options as is!

image

Save the script as "Switch Monitors".

Then go to Settings > Keyboard > Keyboard Shortcuts..

image

Then select Services > General and check the Switch Monitors and double click at the end of the line to map the right key.

image

That's it! You can switch monitors by pressing the right key on your keyboard.

About

Switch the display configuration for your 2 monitors on a Mac

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published