Skip to content

Commit

Permalink
fix: set correct/better values for Dock items
Browse files Browse the repository at this point in the history
  • Loading branch information
Okeanos committed Nov 9, 2024
1 parent e1d6669 commit 85206c0
Showing 1 changed file with 32 additions and 11 deletions.
43 changes: 32 additions & 11 deletions macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -641,31 +641,52 @@ dock_items=(
/Applications/{KeePassXC,Souretree,iTerm}.app
)
for dock_item in "${dock_items[@]}"; do
defaults write com.apple.dock persistent-apps -array-add \
"{
\"tile-data\" = {
\"file-data\" = {
\"_CFURLString\" = \"file:///${dock_item}/\";
\"_CFURLStringType\" = \"15\";
if [[ -r "${dock_item}" ]]; then
defaults write com.apple.dock persistent-apps -array-add \
"{
\"tile-data\" = {
\"file-data\" = {
\"_CFURLString\" = \"file://${dock_item}/\";
\"_CFURLStringType\" = 15;
};
\"file-type\" = 41;
};
};
\"tile-type\"=\"file-tile\";
}"
\"tile-type\" = \"file-tile\";
}"
fi
done

# Wipe all (other) icons from the Dock
# This is only really useful when setting up a new Mac, or if you don’t use
# the Dock to launch apps.
defaults write com.apple.dock persistent-others -array

# Write new list of other Dock items
# Write new list of other Dock items (e.g. adds the Downloads folder to the end)
# arrangement
# 1 -> Name
# 2 -> Date Added
# 3 -> Date Modified
# 4 -> Date Created
# 5 -> Kind
# displayAs
# 0 -> Stack
# 1 -> Folder
#showAs
# 0 -> Automatic
# 1 -> Fan
# 2 -> Grid
# 3 -> List
defaults write com.apple.dock persistent-others -array-add \
"{
\"tile-data\" = {
arrangement = 2;
displayas = 0;
\"file-data\" = {
\"_CFURLString\" = \"file:///Users/${USER}/Downloads/\";
\"_CFURLStringType\" = \"15\";
\"_CFURLStringType\" = 15;
};
\"file-type\" = 2;
showas = 1;
};
\"tile-type\" = \"directory-tile\";
}"
Expand Down

0 comments on commit 85206c0

Please sign in to comment.