Hope everyone is well today,
We recently updated to Casper 10.1.1 and Dockutil which was working great but now seems to have a funky glitch with Dockutil.
Previous to Casper 10.1.1 the Dockutil just worked seamlessly, it just showed the dock and life went on with no issues. Now after the Casper 10.1.1 update it seems to be rewriting the dock three times.
It shows the Proper dock I set up, then wipes the dock to about three items and then after about a 10 or more second wait it shows the proper dock I set up again and after that, it stays. Unless of course you logout and login again as I have it set for each login.
I'd really like to figure this out. I've tried everything that I could try. Is there a NEW delay or something in the new Casper that affects scripts? Just stumped.
I am including my script which is only a little different for each building depending on what is taught or the file share in that area. Thank you in advance to everyone.
!/bin/sh
LoggedInUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");')
LoggedInUserHome="/Users/$LoggedInUser"
configureDefaultDock() {
echo "Logged in user is $LoggedInUser"
echo "Logged in user's home $LoggedInUserHome"
if [ -e /usr/local/bin/dockutil ];
then
dockutilVersion=/usr/local/bin/dockutil --version --version; echo "dockutil version: $dockutilVersion"
/usr/local/bin/dockutil --remove all "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Safari.app' --no-restart --position 1 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Firefox.app' --no-restart --position 2 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Google Chrome.app' --no-restart --position 3 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe Photoshop CC 2017/Adobe Photoshop CC 2017.app' --no-restart --position 4 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe Bridge CC 2017/Adobe Bridge CC 2017.app' --no-restart --position 5 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe Lightroom/Adobe Lightroom.app' --no-restart --position 6 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe InDesign CC 2017/Adobe InDesign CC 2017.app' --no-restart --position 7 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe Illustrator CC 2017/Adobe Illustrator.app' --no-restart --position 8 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe Dreamweaver CC 2017/Adobe Dreamweaver CC 2017.app' --no-restart --position 9 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe Acrobat DC/Adobe Acrobat.app' --no-restart --position 10 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/MAXON/CINEMA 4D R18/CINEMA 4D.app' --no-restart --position 11 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Unity/Unity.app' --no-restart --position 12 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Autodesk/maya2017/Maya.app' --no-restart --position 13 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe Premiere Pro CC 2017/Adobe Premiere Pro CC 2017.app' --no-restart --position 14 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Avid Media Composer/AvidMediaComposer.app' --no-restart --position 15 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Adobe After Effects CC 2017/Adobe After Effects CC 2017.app' --no-restart --position 16 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Microsoft Word.app' --no-restart --position 17 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/Self Service.app' --no-restart --position 18 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Applications/System Preferences.app' --no-restart --position 19 "$LoggedInUserHome"
/usr/local/bin/dockutil --add '~/Documents' --no-restart "$LoggedInUserHome"
/usr/local/bin/dockutil --add '~/Downloads' --no-restart "$LoggedInUserHome"
/usr/local/bin/dockutil --add '/Library/Servers/ServersMetro' --view fan --display folder --no-restart "$LoggedInUserHome"
touch $LoggedInUserHome/Library/Preferences/com.company.docksetup.plist
else
echo "dockutil not installed, skipping initial dock setup..."
fi
}
configureDefaultDock
killall -KILL Dock
exit 0
