background

Shortcuts and Automations

macOS Shortcuts have a number of advantages over UI alternatives:

  • can be triggered using hotkeys
  • can be shown in the menubar
  • can be searched and triggered from Raycast
  • can even be automated using apps like

Here are some helpful tips for using the shortcuts below:

Add to menubar

Assign a hotkey

Problem

After standby or restart, some monitors might get swapped around by the OS.

You can read more about this problem in my Weird monitor bugs article.

Solution

This shortcut will swap the positions and orientations of two screens of your choosing.

Problem

After standby or restart, some monitors might get swapped around by the OS.

If you use 3 or more monitors arranged horizontally that have this problem, swapping them around won't help much.

You can read more about this problem in my Weird monitor bugs article.

Note: for 2-monitor layouts, use the Swap Monitors shortcut

Solution

This shortcut will arrange the monitors horizontally in a specific order.

How it works:

  • on each monitor you'll see a number
  • type the numbers on the keyboard from left to right (start with the number on the leftmost monitor)
  • Lunar will arrange the monitors in the order of the typed numbers

press Esc to cancel or Enter to partially arrange the monitors selected so far

Problem

Traveling with your MacBook from office to home might need you to switch between different sets of monitors.

That means you always have go through the annoying process of opening System Settings to manually arrange the screens with the mouse.

Solution

This shortcut will arrange external monitors above the MacBook in setups with up to 3 external monitors.

Single Monitor

Dual Monitor

Problem

To connect an iPad as a Sidecar display, you need to go clicking through Control Center or System Settings.

Then after the Sidecar connects, it might not be in the position that you want relative to the main display.

Solution

This shortcut will connect the Sidecar and position it using a single hotkey. The same hotkey can also disconnect the Sidecar.

Problem

HDR monitors have this HDR checkbox somewhere in System Settings, and that seems to be the only way to enable/disable the high dynamic range.

Most of the time people want to keep HDR disabled for normal work, and enable it on demand for watching videos and graphic work.

Solution

This shortcut allows you to toggle HDR on and off by moving the mouse to the display you want to toggle, and pressing the assigned hotkey.

Problem

Looking at a screen for prolonged periods of time can weaken the eye muscles because of constantly focusing at small distances.

The 20/20/20 technique is based on a simple principle: every 20 minutes take a 20 second break to look at something 20 meters away.

Solution

This shortcut darkens all the screens every 20 minutes and brings them back to normal brightness after 20 seconds.

It also checks if the camera is on first, to avoid getting a dark screen while in a meeting or video call.

Problem

If you have multiple monitors connected to your current Mac (let's say through USB-C, doesn't really matter) and the same monitors are maybe connected to another device (let's say on HDMI), you might want to switch the monitors between devices easily.

This is usually done through a KVM device but if the monitor supports input switching through DDC, you can do all this with a single Shortcut.

Note: While Lunar already has a native UI for assigning hotkeys to inputs, it can't assign the same hotkey to multiple monitors.

input hotkeys

Solution

This shortcut switches each monitor to a specific input, waiting 3 seconds before each switch to allow the screen reconfiguration process to stabilize.

Custom inputs

Some monitors have their inputs mapped to non-standard values. Through Shortcuts you can send arbitrary values to the monitor by using the DDC Write Value to Screen action.

ddc input shortcut

Problem

Cleaning a screen is easier when it's turned off, but turning it off and on again can be annoying because you might trigger unwanted window re-arrangements.

Also, if you have multiple monitors, you might want to turn them all off at once for that.

The keyboard and trackpad should also have a way to be disabled while cleaning.

Solution

This shortcut turns off all the screens and disables the keyboard and trackpad for a configurable amount of time.

There's a way to keep it active indefinitely, and can be disabled manually by pressing ⌘ Command more than 8 times in a row.

It can also be assigned to a hotkey so you can trigger it easily.

Problem

When Screen Sharing to another device, that device's screen might be smaller or larger so things will look weird.

Switching to a different resolution can help to match the other screen size and shape better.

Solution

This shortcut sets a resolution based on the chosen sharing target and can be assigned to a hotkey so you can trigger it right after starting Screen Sharing.

Problem

For doing graphic work on a reference display like the Pro Display XDR, you might want to use a specific Reference Preset to get accurate color rendering.

Doing this through the System Settings requires you to go through many point and click steps.

Solution

This shortcut activates a preset based on the chosen workflow and can be assigned to a hotkey so you can trigger it easily.

Problem

Adjusting the color balance of your screen can be useful for many reasons:

  • reducing eye strain
  • getting more accurate colors
  • seeing more detail in the black regions of a movie or game.

This can already be done with the Gamma Control app, but one might want to combine this with other actions in a single Shortcut.

Solution

This shortcut activates a color preset based on the chosen workflow and can be assigned to a hotkey so you can trigger it easily.