Setting dock position to immutable not working

dock

I tried to make the dock position immutable by using this command:

defaults write com.apple.dock position-immutable -bool yes

and then

killall Dock

But this didn't work. It did write somewhere the line:
"position-immutable" = 1;
as this appears in the output of

defaults read

However, it has no effect on the dock behavior. Is there no way to prevent it from jumping around? I'm willing to install whatever tool is necessary to accomplish this.
Thanks

Best Answer

I have tried the setting and this works fine with macOS 10.12 Sierra:

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

edit: sorry, I misread the command. The command to lock the position works too:

defaults write com.apple.Dock position-immutable -bool yes; killall Dock