Skip to content

Instantly share code, notes, and snippets.

@olssonm
Last active March 6, 2025 13:40
Show Gist options
  • Save olssonm/87e0d72b1ef80fffb6f5a1fba1d17ea1 to your computer and use it in GitHub Desktop.
Save olssonm/87e0d72b1ef80fffb6f5a1fba1d17ea1 to your computer and use it in GitHub Desktop.
Disable resizing of the macOS dock
defaults write com.apple.dock size-immutable -bool true; killall Dock
@pierreneter
Copy link

update for 2020:

defaults write com.apple.dock size-immutable -bool true; killall Dock

@pierreneter
Copy link

this comment just for SEO:

How to Lock the Dock Size?

@pierreneter
Copy link

How to disable changing the contents of Dock, Dock Contents of macOS
How to lock the contents of Dock, Dock Contents of macOS

defaults write com.apple.dock contents-immutable -bool true; killall Dock

@dislick
Copy link

dislick commented Mar 8, 2020

Thank you, I was going crazy!

@jameynakama
Copy link

This doesn't work. It only disables the ability to change the size in preferences. It still resizes itself depending on how many apps are open.

@olssonm
Copy link
Author

olssonm commented Jul 15, 2020

@jameydeorio – You're thinking of another type of resize. What this does is to disable the resizing of the Dock and icons by for example pulling in the divider (i.e. between apps and folder) in the Dock.

Disabling horizontal resizing regardless off the number of apps as you're talking about is as far as I know not possible in macOS.

@jameynakama
Copy link

I realized this after I commented. BUT, I also figured out if you [x] Minimize windows into application icon, it does what I've been looking for for ages :)

@marcosatanaka
Copy link

Another useful setting is to lock the icon sizes, so that the Dock is always the same height:

defaults write com.apple.dock tilesize -int 60; killall Dock

Copy link

ghost commented May 12, 2021

update for 2020:

defaults write com.apple.dock size-immutable -bool true; killall Dock

how do I undo this

@olssonm
Copy link
Author

olssonm commented May 12, 2021

@Supaflowin

defaults write com.apple.dock size-immutable -bool false; killall Dock

@gunter423
Copy link

OMG THANK YOU

@swoondrones
Copy link

OMG THANK YOU ... of what terminal command are you thanking? I have tried all of these and none lock the length of the dock. Soo what worked for you?

@olssonm
Copy link
Author

olssonm commented Nov 28, 2024

@swoondrones This doesn't lock the length of the dock (if you add/remove apps of course the dock size will change). This command prevents the actual icon sizes in the dock to change and prevent accidental size change by grabbing the dock divider.

@swoondrones
Copy link

@swoondrones This doesn't lock the length of the dock (if you add/remove apps of course the dock size will change). This command prevents the actual icon sizes in the dock to change and prevent accidental size change by grabbing the dock divider.

Hi there. So do you know how I can fix the length of the dock? it is obviously possible, as it was happening in Sonoma, but I lost when I upgraded to Sequoia. So there is a way to fix the length of the dock and the tile size dynamically changes to fit the length of the dock. If you know about photography, think of it as the length of the dock changes when adding/deleting dock items as shutter speed priority, and the tile sizes changing to a fixed length as aperture priority. I hope that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment