top of page
  • Writer's pictureBlake

How to Automatically Switch External Display Position on Mac with Automator and Displayplacer (Works with Arzopa)



Are you tired of manually adjusting your external display settings every time you want to move it from the left to the right of your MacBook, or vice versa? You're in luck! This guide will walk you through automating this process using Automator and a handy tool called Displayplacer on macOS.


Prerequisites

Before we dive into the automation process, ensure your Mac is ready by checking the following:

  • macOS Catalina or later (for using Zsh as the default shell).

  • Homebrew installed (for installing Displayplacer).

  • Basic familiarity with Terminal and Automator.

Step 1: Install Displayplacer

Displayplacer is a command-line utility that allows us to precisely control display settings, including the arrangement. Here's how to install it:

  1. Open Terminal on your Mac.

  2. Install Homebrew if you haven't already by running the following:

    1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  3. Tap and install Displayplacer by executing:

    1. brew tap jakehilborn/jakehilborn && brew install displayplacer

Step 2: Update Command Line Tools (If Needed)

If you encounter any errors related to outdated Command Line Tools, follow these steps to update:

  1. Update via Terminal with:

    1. xcode-select --install

  2. Alternatively, update through System Settings by navigating to Software Update and installing any available updates for the Command Line Tools.

Step 3: Identify Your Display Configuration

  1. Make sure the external monitor is connected and turned on.

  2. List display configurations with Displayplacer by running:

    1. displayplacer list

  3. Note the Persistent Screen ID of your external display, as it will be used in your Automator script.


Step 4: Create an Automator Workflow

  1. Open Automator and create a new Application.

  2. Add a 'Run Shell Script' action to the workflow.

  3. Set the Shell to /bin/zsh at the top of the action.

  4. Specify the full path to Displayplacer in the script area, followed by your desired configuration command. For example, to move the display to the left and center it vertically:

    1. /opt/homebrew/bin/displayplacer "id:<Your-Persistent-Screen-ID> res:1920x1080 hz:60 color_depth:8 scaling:off origin:(-1920,62) degree:0" Adjust the command with your screen's resolution and positioning.

    2. If you need help, calculating the origin position, ask Chat GPT for help. The step above will also give you the resolution of your macbook.

      1. Prompt: Using the example code <insert code here> how would I set it to be to the left, but in the middle for my macbook which has a display resolution of 1234x123 (use your resolution).


Step 5: Save and Use Your Workflow

  1. Save your Application with a descriptive name, like "Switch Display to Left."

  2. You can also do this as a quick action, but I prefer to have an app icon on my desktop.

  3. You can download these as a template, and all you need to do is change the variables. MAKE SURE YOU REPLACE THE ID, RES, HZ, COLOR DEPTH, SCALING AND ORIGIN WITH YOUR SPECIFIC VARIABLES.

Automation of Display Location
.zip
Download ZIP • 7.85MB


Troubleshooting Tips

  • Command not found error: Ensure the full path to Displayplacer is used in your Automator script. Use which displayplacer in Terminal to find the correct path.

  • Permission issues: Make sure you have the necessary permissions to execute Displayplacer. Running sudo chmod +x /opt/homebrew/bin/displayplacer in Terminal can resolve execution permission issues.

Conclusion

With this setup, you can effortlessly switch your external display's position with just a few clicks or a keyboard shortcut, eliminating the need to navigate through System Preferences. Automator, combined with Displayplacer, offers a powerful way to customize your display arrangement workflow on macOS, saving you time and hassle.

Happy automating!

84 views0 comments

Recent Posts

See All

Comments


bottom of page