Feeling meoWow • 5 months ago
I'm so over constantly switching up my monitor setup based on my productivity vibes. Sometimes, I just miss the vibes of my MacBook keyboard, so I'll slide my laptop under the screen to get that throwback typing feel.
But then there are those moments when I'm in full grind mode, that's when I shift my laptop to the left, creating my own little zone for maximum focus and productivity.
I've always appreciated how macOS cleverly remembers screen configurations, effortlessly switching to the setup I last used for each screen. But when it comes to tweaking layouts or resolutions manually, constantly diving into system settings can be a drag. I've often wondered if there's a smoother way to handle these adjustments without the hassle.
Introducing Displayplacer & iCanHazShortcut
I found this macOS command line utility combo, displayplacer from Jake Hilborn and iCanHazShortcut from Deseven ending the hassle of manually adjusting screen configurations.
Getting Started
Ensure that you have Homebrew installed before proceeding:
brew tap jakehilborn/jakehilborn && brew install displayplacer
You can set up your layout as desired using the Mac Displays Utility in settings. Once you've completed your setup, execute the following command:
displayplacer list
it will display various options. Scroll to the bottom to find the correct command to configure your displays whenever they need adjustment. In my case, it appeared like this:
displayplacer "id:37D8832A-2D66-02CA-B9F7-8F30A301B230 res:1800x1169 hz:120 color_depth:8 enabled:true scaling:on origin:(0,0) degree:0" "id:D596F920-EB66-46A4-8489-4F94950AB996 res:3440x1440 hz:165 color_depth:8 enabled:true scaling:off origin:(1800,-221) degree:0"
Now we can install iCanHazShortcut by executing this command:
brew install icanhazshortcut
The application can be found in your Launchpad. You can now configure your own shortcut. For example, I use Ctrl + Cmd + Shift + 1 for my setup number 1. In the command section, you'll need to add the path to your Displayplacer Homebrew installation. You can find this path by executing the following command:
brew info displayplacer
It will display the Displayplacer installation path. Simply combine the path with the configuration executed from displayplacer list before, like this:
/Users/aliffazfar/homebrew/Cellar/displayplacer/1.4.0/bin/displayplacer "id:37D8832A-2D66-02CA-B9F7-8F30A301B230 res:1800x1169 hz:120 color_depth:8 enabled:true scaling:on origin:(0,0) degree:0" "id:D596F920-EB66-46A4-8489-4F94950AB996 res:3440x1440 hz:165 color_depth:8 enabled:true scaling:off origin:(-746,-1440) degree:0"
Finally, give each action a cool name, like 'Setup 1'. Repeat these steps for Setup 2 and beyond. Now, you're all set to switch your monitor setup like a boss using your slick shortcut keys. Below is a sample of my shortcuts for both of my favorite setups.
This had been bothering me for years! Finally, I'd had enough and took care of it.
A quick switch
I hope you find these tips helpful! If you discover other ways to integrate it with automation tools, let me know. Feel free to share this post if you found it useful!
Enjoy this blog? Feel free to share