Skip to main content
edited body
Source Link
IconDaemon
  • 19.6k
  • 10
  • 44
  • 60

I figured out how to automate the display switching using a keyboard shortcut with displayplacer and it works like a charm!😎

I setup a macro using Keyboard Maestro to automatically cycle the desktop arrangement using a keyboard shortcut.

Instructions to setup Keyboard Shortcut

  1. Install displayplacer using Homebrew
  2. Use Keyboard MeastroMaestro and create a Macro
  3. Add the Execute Shell Script Action for each display you have (I have 3).
  4. Open System Preferences > Displays and change your arrangement by placing the menu bar to the right by 1 screen (right-to-left type direction)
  5. Open your terminal and run the displayplacer list command
  6. Copy the bottom output, e.g. displayplacer "id:<screenId> res:<width>x<height> hz:<num> color_depth:<num> scaling:<on/off> origin:(<x>,<y>) degree:<0/90/180/270>"
  7. Paste the output into your Macro Action.
  8. Repeat steps 4-7 and stop after you've done the main screen you keep your menu bar on.
  9. Setup a keyboard shortcut for your Macro.
  10. Run your Macro with your new shortcut and watch the magic happen right before your eyes.

Helpful Tips

  1. If you have an issue with running displayplacer from Keyboard Maestro, it's likely that you're using a different bash in your terminal/iTerm like oh-my-zsh when you installed it using Homebrew. If thats the case, follow these instructions from my other post to fix your displayplacer binary reference.

  2. Here's a screenshot to view my working Keyboard Maestro setup with displayplacer.

  3. You may need to run your macro a second time if you accidentally hit your shortcut.

I figured out how to automate the display switching using a keyboard shortcut with displayplacer and it works like a charm!😎

I setup a macro using Keyboard Maestro to automatically cycle the desktop arrangement using a keyboard shortcut.

Instructions to setup Keyboard Shortcut

  1. Install displayplacer using Homebrew
  2. Use Keyboard Meastro and create a Macro
  3. Add the Execute Shell Script Action for each display you have (I have 3).
  4. Open System Preferences > Displays and change your arrangement by placing the menu bar to the right by 1 screen (right-to-left type direction)
  5. Open your terminal and run the displayplacer list command
  6. Copy the bottom output, e.g. displayplacer "id:<screenId> res:<width>x<height> hz:<num> color_depth:<num> scaling:<on/off> origin:(<x>,<y>) degree:<0/90/180/270>"
  7. Paste the output into your Macro Action.
  8. Repeat steps 4-7 and stop after you've done the main screen you keep your menu bar on.
  9. Setup a keyboard shortcut for your Macro.
  10. Run your Macro with your new shortcut and watch the magic happen right before your eyes.

Helpful Tips

  1. If you have an issue with running displayplacer from Keyboard Maestro, it's likely that you're using a different bash in your terminal/iTerm like oh-my-zsh when you installed it using Homebrew. If thats the case, follow these instructions from my other post to fix your displayplacer binary reference.

  2. Here's a screenshot to view my working Keyboard Maestro setup with displayplacer.

  3. You may need to run your macro a second time if you accidentally hit your shortcut.

I figured out how to automate the display switching using a keyboard shortcut with displayplacer and it works like a charm!😎

I setup a macro using Keyboard Maestro to automatically cycle the desktop arrangement using a keyboard shortcut.

Instructions to setup Keyboard Shortcut

  1. Install displayplacer using Homebrew
  2. Use Keyboard Maestro and create a Macro
  3. Add the Execute Shell Script Action for each display you have (I have 3).
  4. Open System Preferences > Displays and change your arrangement by placing the menu bar to the right by 1 screen (right-to-left type direction)
  5. Open your terminal and run the displayplacer list command
  6. Copy the bottom output, e.g. displayplacer "id:<screenId> res:<width>x<height> hz:<num> color_depth:<num> scaling:<on/off> origin:(<x>,<y>) degree:<0/90/180/270>"
  7. Paste the output into your Macro Action.
  8. Repeat steps 4-7 and stop after you've done the main screen you keep your menu bar on.
  9. Setup a keyboard shortcut for your Macro.
  10. Run your Macro with your new shortcut and watch the magic happen right before your eyes.

Helpful Tips

  1. If you have an issue with running displayplacer from Keyboard Maestro, it's likely that you're using a different bash in your terminal/iTerm like oh-my-zsh when you installed it using Homebrew. If thats the case, follow these instructions from my other post to fix your displayplacer binary reference.

  2. Here's a screenshot to view my working Keyboard Maestro setup with displayplacer.

  3. You may need to run your macro a second time if you accidentally hit your shortcut.

Source Link
Billy
  • 271
  • 3
  • 3

I figured out how to automate the display switching using a keyboard shortcut with displayplacer and it works like a charm!😎

I setup a macro using Keyboard Maestro to automatically cycle the desktop arrangement using a keyboard shortcut.

Instructions to setup Keyboard Shortcut

  1. Install displayplacer using Homebrew
  2. Use Keyboard Meastro and create a Macro
  3. Add the Execute Shell Script Action for each display you have (I have 3).
  4. Open System Preferences > Displays and change your arrangement by placing the menu bar to the right by 1 screen (right-to-left type direction)
  5. Open your terminal and run the displayplacer list command
  6. Copy the bottom output, e.g. displayplacer "id:<screenId> res:<width>x<height> hz:<num> color_depth:<num> scaling:<on/off> origin:(<x>,<y>) degree:<0/90/180/270>"
  7. Paste the output into your Macro Action.
  8. Repeat steps 4-7 and stop after you've done the main screen you keep your menu bar on.
  9. Setup a keyboard shortcut for your Macro.
  10. Run your Macro with your new shortcut and watch the magic happen right before your eyes.

Helpful Tips

  1. If you have an issue with running displayplacer from Keyboard Maestro, it's likely that you're using a different bash in your terminal/iTerm like oh-my-zsh when you installed it using Homebrew. If thats the case, follow these instructions from my other post to fix your displayplacer binary reference.

  2. Here's a screenshot to view my working Keyboard Maestro setup with displayplacer.

  3. You may need to run your macro a second time if you accidentally hit your shortcut.