Skip to content

JakubBelau/DockAnchor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚓ DockAnchor

Stop your macOS Dock from jumping between monitors - permanently.

If you use multiple external displays on a Mac, you already know the pain: you move your cursor near the bottom edge of the "wrong" screen, and suddenly your Dock teleports there. It disrupts your workflow, resizes your windows, and never seems to stay where you put it.

DockAnchor is a tiny, free, open-source fix. No app to install, no background daemon eating your RAM - just a couple of scripts that tweak a built-in macOS setting and make sure it stays tweaked, even after logins, restarts, and most system updates.

🇵🇱 Czytaj po polsku

The problem this solves

Also known as:

  • macOS Dock keeps jumping / moving / switching between monitors
  • macOS Dock jumps to second monitor
  • Dock changes screen when using multiple displays
  • Dock teleports to the wrong display on macOS multi-monitor setup
  • "Displays have separate Spaces" Dock bug

This has been a known annoyance on macOS since at least OS X Mavericks (2013) and still affects modern macOS versions with multi-monitor setups.

Why it happens

By default, macOS moves the Dock to whichever display your cursor touches at the bottom edge. Apple considers this "by design," but in real multi-monitor workflows (coding, video editing, trading desks, streaming setups) it's mostly just annoying.

What DockAnchor does

It increases the Dock's internal autohide-delay value to a very large number. This doesn't disable the Dock or break autohide - it simply makes the Dock "commit" to a display instead of instantly jumping the moment your cursor grazes the bottom edge of another screen.

On top of that, DockAnchor installs a lightweight LaunchAgent that silently re-applies the setting every time you log in - so if a macOS update ever resets your Dock preferences, the fix reapplies itself automatically. Set it up once, forget about it forever.

Installation

Option A - Terminal (recommended)

git clone https://github.com/YOUR_USERNAME/DockAnchor.git
cd DockAnchor
chmod +x install.sh
./install.sh

Option B - No terminal needed

  1. Download this repository as a ZIP (green "Code" button → "Download ZIP") and unzip it.
  2. Go into the scripts folder.
  3. Double-click DockAnchor.command.
  4. If macOS shows a security warning ("cannot be opened because it is from an unidentified developer"), right-click the file → Open → confirm Open.
  5. Choose option 1 to install the fix.

Uninstalling

Terminal

./uninstall.sh

No terminal

Double-click scripts/DockAnchor.command again and choose option 2.

FAQ

Does this require admin/root access? No. It only changes a preference in your own user account (~/Library/Preferences/com.apple.dock.plist) and installs a LaunchAgent in your own user folder. No sudo needed.

Is this safe? Yes. It uses the standard macOS defaults command, the same mechanism Apple itself uses to store app preferences. Nothing is downloaded or executed beyond what's in this repository, and everything is fully reversible with uninstall.sh.

Will this survive a macOS update? The setting itself usually survives updates. As extra insurance, the LaunchAgent re-applies it every time you log in, so even if an update resets it, it self-heals on your next login.

Does this disable Dock autohide? No. If you don't use autohide, this has zero visible effect other than fixing the jumping behavior. If you do use autohide, behavior is unaffected - this setting only affects how eagerly the Dock switches displays.

Can I customize the fix? Yes - open install.sh and change the FIX_VALUE variable if you want to experiment with different delay values.

Contributing

Issues and pull requests are welcome. If you find this useful, consider starring the repo so others with the same multi-monitor headache can find it.

License

MIT - see LICENSE.


Not affiliated with Apple Inc. "macOS" and "Dock" are trademarks of Apple Inc.

About

Stop the macOS Dock from jumping between monitors on a multi-display setup. A free, open-source, one-command fix that persists across logins and system updates.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages