⬆️ ⬇️

What we need to dock set up

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:



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).



image



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:



image



Source: https://habr.com/ru/post/84812/



All Articles