I can't find a way to make my dock only resize horizontally when new apps appear. Currently when one does, the whole dock shrinks vertically and expands horizontally.
Is there any way to only expand the dock horizontally?
This answer mentions how to lock the dock, but doesn't mention that you have to reload the dock in order for the changes to be applied.
If you want to lock the dock so that you can't resize it, run this command in a terminal:
defaults write com.apple.dock size-immutable -bool yes && killall Dock
If you want to unlock the dock so that you can resize it, run this command in a terminal:
defaults write com.apple.dock size-immutable -bool no && killall Dock
I think I found a way to lock the change of icons' size in dock:
defaults write com.apple.Dock size-immutable -bool yes