Dockutil seems to be a bit funky in Casper 10.1.1, or I did something wrong in earlier versions of Casper

skinford
Contributor II

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

8 REPLIES 8

skinford
Contributor II

Can I ask the two of you, @perrycj and @mm2270 if you have a moment to look at this post of mine? I saw the wonderful info that you have given about Dockutil and wanted to see if you have experienced this issue at all.

Thank you, both in advance for any insight that either or both of you or anyone else may have. I am indebted to everyone here at JAMF for the assistance that you have given.

Have a very great day today!

Asnyder
Contributor III

@skinford This wouldn't be a jamf issue. Dockutil isn't associated with jamf at all. It's its own binary. EDIT: I didn't read your post all the way.To clarify, the dock is set correctly but it's being killed three times first?

!/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

I reposted your script for readability. Is it returning any errors?

skinford
Contributor II

@Asnyder correct, it rewrites the dock from the correct version to a couple of icon apps version back to the correct version.
I realize why it wipes the first time is because of this line, /usr/local/bin/dockutil --remove all "$LoggedInUserHome", but it didn't do that before 10.1.1, it never showed the smaller dock and then the correct dock again.
I will check but as far as I know, I haven't seen any error. I can check logs though.

Thank you, @Asnyder

Asnyder
Contributor III

/usr/local/bin/dockutil --remove all "$LoggedInUserHome" and

killall -KILL Dock

will cause the dock to flash.

configureDefaultDock May as well but I'm not sure on that one.

donmontalvo
Esteemed Contributor II

Would suggest pinging Kyle Crawford via Github:

https://github.com/kcrawford/dockutil

--
https://donmontalvo.com

perrycj
Contributor III

@skinford Were you able to get this going?

skinford
Contributor II

@perrycj Morning,

Had to put it on hold for awhile. I have tried editing everything that was suggested but it flashes three times and gets the correct dock with my original script. If I delete anything that was suggested the dock comes up with many question marks so I believe that I have to live with the flash. Wish I knew what changed, right after we ran a Casper update to version 10+ it started doing this. Worked all the way up to 9.100. If my script is off I'd sure like to find out where. I have even put questions on the dockutil GitHub site and no one knows why.

I'll keep digging @perrycj but at this point stuck with the three flashes.

joethedsa
Contributor II

@skinford, I just started using dockutil (and it is great!). I'm experiencing the same thing. My Cloud JSS instance is 10.11.1. Are you having this issue still?