-
Notifications
You must be signed in to change notification settings - Fork 1
/
DockFixupOverride.sh
executable file
·86 lines (62 loc) · 2.97 KB
/
DockFixupOverride.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
# Jason Filice
# Technology Support Services in IT
# California State University, Monterey Bay
# https://csumb.edu/it
#
# Use as script in Jamf JSS.
# Change History:
# 2022/07/21: Creation.
#
SCRIPTNAME=`/usr/bin/basename "$0"`
SCRIPTDIR=`/usr/bin/dirname "$0"`
# Jamf JSS Parameters 1 through 3 are predefined as mount point, computer name, and username
pathToScript=$0
mountPoint=$1
computerName=$2
userName=$3
shift 3
# Shift off the $1 $2 $3 parameters passed by the JSS so that parameter 4 is now $1
echo pathToScript=$pathToScript
echo mountPoint=$mountPoint
echo computerName=$computerName
echo userName=$userName
# https://support.apple.com/en-us/HT207568
# You can use a configuration profile to set an alternative plist. In the profile, set the AllowDockFixupOverride key to true in the com.apple.dock domain.
# The Apple provided plist is located at /System/Library/CoreServices/Dock.app/Contents/Resources/com.apple.dockfixup.plist.
# You can put a modified copy of this file in the /Library/Preferences folder.
# If the configuration profile is active and the com.apple.dockfixup.plist file isn’t located in /Library/Preferences, the original plist and customized plist settings won’t work.
# https://medium.com/@opragel/how-to-customize-stop-dockfixup-on-macos-f349cd3c7b15
# ## Below are the keys included with Apple’s plist:
# “add-app”
# “add-doc”
# move
# “remove-file"
# replace
# "system-apps"
# versions
#
# ## Brief description of those keys:
# "add-app" Adds app to Dock, either before (left side) or after (right side)
# "add-doc" Add a folder to Dock
# "move" Changes path of matching dock items to new paths
# "replace" Replaces app currently on Dock with another app (iPhotos -> Photos)
# "remove-file" Remove an app/item from Dock
# Copy /System/Library/CoreServices/Dock.app/Contents/Resources/com.apple.dockfixup.plist
# to /Library/Preferences/com.apple.dockfixup.plist
# Then modify /Library/Preferences/com.apple.dockfixup.plist using defaults command
# Remove add-app key
/bin/cp /System/Library/CoreServices/Dock.app/Contents/Resources/com.apple.dockfixup.plist /Library/Preferences/com.apple.dockfixup.plist
echo "read /Library/Preferences/com.apple.dockfixup.plist 'add-app'..."
/usr/bin/defaults read /Library/Preferences/com.apple.dockfixup.plist 'add-app'
echo "delete /Library/Preferences/com.apple.dockfixup.plist 'add-app'..."
/usr/bin/defaults delete /Library/Preferences/com.apple.dockfixup.plist 'add-app'
/usr/bin/defaults write /Library/Preferences/com.apple.dockfixup.plist 'add-app' -array
/bin/chmod 644 /Library/Preferences/com.apple.dockfixup.plist
/usr/bin/defaults read /Library/Preferences/com.apple.dockfixup.plist
# /usr/bin/defaults write /Library/Preferences/com.apple.dock.plist AllowDockFixupOverride -bool true
# /bin/chmod 644 /Library/Preferences/com.apple.dock.plist
echo "read /Library/Preferences/com.apple.dockfixup.plist..."
/usr/bin/defaults read /Library/Preferences/com.apple.dock.plist
exit 0