What should we set up the dock
There are many programs that allow you to configure the dock, add or change its functionality, etc., etc. Personally, from the whole variety offered, I was only interested in a few specific things:
There are native terminal commands for all these operations. Well, for greater convenience, so as not to type code manually each time, you can create small programs in Automator.
To prohibit changing the position of icons in the dock:
Accordingly, to cancel such a ban, you must replace true at false at the end:
To prohibit changing the size of the dock:
To cancel a ban:
When adding a separator to the dock (the empty space between the icons) there is one caveat. For programs and documents (left and right parts of the dock), there are two different commands.
To add a separator to programs:
To add a separator to documents:
The separator will need to be dragged manually to the desired position. To remove the separator, just pull it out of the dock.
Well, now about convenience. Open Automator, select "Program" as a template. In the column “Libraries” in the leftmost column, select “Utilities”, and from the second column, “Run shell script”. We write the desired script (can be combined).

Save the finished program to disk.
Then you can assign a shotcat to start, or just conveniently place it ... It's really more convenient for anyone, for example, I have solved it like this:

- The ban on changing the location of the icons in the dock (well, and when necessary, the quick lifting of such a ban).
- The ban on changing the size of the dock (choose the best and fix).
- Adding dividers to the dock to visually highlight applications in groups.
There are native terminal commands for all these operations. Well, for greater convenience, so as not to type code manually each time, you can create small programs in Automator.
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 false at the end:
defaults write com.apple.dock contents-immutable -bool false killall dock
To prohibit changing the size of the dock:
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 separator to the dock (the empty space between the icons) there is one caveat. For programs and documents (left and right parts 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 will need to be dragged manually to the desired position. To remove the separator, just pull it out of the dock.
Well, now about convenience. Open Automator, select "Program" as a template. In the column “Libraries” in the leftmost column, select “Utilities”, and from the second column, “Run shell script”. We write the desired script (can be combined).

Save the finished program to disk.
Then you can assign a shotcat to start, or just conveniently place it ... It's really more convenient for anyone, for example, I have solved it like this:
