There are many programs that allow you to customize the dock, add or change its functionality, etc., etc. Personally, of all the diversity offered, I was interested in just a few specific things:
- The ban on changing the location of the icons in the dock (well, when necessary, the rapid abolition of such a ban).
- The ban on changing the size of the dock (pick the best and fix).
- Adding to the dock separators for visual selection of applications in groups.
For all these operations, there are native terminal commands. Well, for more convenience, in order not to dial the code every time manually, you can create small programs in Automator.
In order to prohibit changing the position of icons in the dock:
defaults write com.apple.dock contents-immutable -bool true
killall dock
Accordingly, to cancel such a ban, you must replace true at the end with false:
')
defaults write com.apple.dock contents-immutable -bool false
killall dock
To prohibit dock resizing:
defaults write com.apple.Dock size-immutable -bool true
killall dock
To cancel a ban:
defaults write com.apple.Dock size-immutable -bool false
killall dock
When adding a delimiter to the dock (the empty space between the icons) there is one nuance. For programs and documents (left and right side of the dock) there are two different commands.
To add a separator to programs:
defaults write com.apple.dock persistent-apps-array-add '{tile-data = {}; tile-type = "spacer-tile";}
killall dock
To add a separator to documents:
defaults write com.apple.dock persistent-others-array-add '{tile-data = {}; tile-type = "spacer-tile";}
killall dock
The separator must be dragged manually to the desired position. To remove the separator, just pull it out of the dock.
And now about convenience. Open Automator, select “Program” as a template. In the leftmost column “Libraries”, select “Utilities”, and from the second column “Run shell script”. Register the desired script (can be combined).
We save the finished program to disk.
Then you can assign a shot to start, or simply convenient to place ... That's more convenient for someone, for me, for example, it’s decided like this: