Dockutil and Monterey - Cannot figure out what is wrong.

Contributor III

I have been using dockutil for years without issue. I have historically been putting the shell script in the Users/Shared/bin folder and the plist in the user LaunchAgent folder. Like I said, years have been working...

Now that Python is not installed by default and using the newest version of Dockutil, I cannot get it to run. I have tried to get this to run via Jamf. I have used Jamf to dump the two files into their respective homes on the endpoint. Heck, I have even manually added the files to a target computer just for testing. All I get is an "unable to execute (path to .sh file) Operation not permitted. I don't know what I am doing wrong, but it's making my hair fall out.

Here are my scripts...


loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

$dockutilbin --remove all --no-restart $loggedInUserPlist; sleep 2
$dockutilbin --add file:///System/Applications/ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Google\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Adobe\ Bridge\ 2022/Adobe\ Bridge\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Adobe\ Photoshop\ 2022/Adobe\ Photoshop\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Adobe\ Lightroom\ Classic/Adobe\ Lightroom\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Adobe\ Illustrator\ 2022/Adobe\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Adobe\ Premiere\ Pro\ 2022/Adobe\ Premiere\ Pro\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Adobe\ Substance\ 3D\ Designer/Adobe\ Substance\ 3D\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Adobe\ Substance\ 3D\ Painter/Adobe\ Substance\ 3D\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Autodesk/maya2023/ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/TVPaint\ Animation\ 11.5\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/Corel\ Painter\ 2021/Corel\ Painter\ --no-restart $loggedInUserPlist
$dockutilbin --add file:///Applications/ --no-restart $loggedInUserPlist
$dockutilbin --add '/Applications/' --view grid --display folder --sort name --no-restart $loggedInUserPlist
$dockutilbin --add '~/Downloads/' --view fan --display folder --sort name $loggedInUserPlist

exit 0

defaults write tilesize -int 40
defaults write magnification -bool true

exit 0

 Here is the plist that should be triggering everything...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

 I will say that only one time did the dock update to include the items listed in the script above. It just added them to the default list that populates the dock out of the box. I have never been able to reproduce it.

What am I missing?

Ultimately I would love to have this script run from Jamf so I don't have to use the script and plist files on the computer. Docutil is installed on every computer I manage...

Before Monterey, this is the script that worked... It worked a treat too. Dock would show up for a second with just the trash can, blink off, then blink back on as requested with the settings and everything.


# Running checkSetupDone function to determine if the rest of this script needs to run.
# Yes, if $HOME/Library/Preferences/com.ARC.docksetup.plist file does not exist.
# Otherwise, assume this setup script has already run for this user and does not
# need to run again.

checkSetupDone()    {

    if [ -f $HOME/Library/Preferences/com.ARC.docksetup.plist ] ; then
        exit 0


configureDefaultDock()  {


    $DOCKUTIL --remove all --no-restart

    $DOCKUTIL --add '/System/Applications/' --no-restart

    $DOCKUTIL --add '/Applications/' --no-restart
    $DOCKUTIL --add '/Applications/Google' --no-restart
    $DOCKUTIL --add '/Applications/Adobe Bridge 2022/Adobe Bridge' --no-restart
    $DOCKUTIL --add '/Applications/Adobe Photoshop 2022/Adobe Photoshop' --no-restart
    $DOCKUTIL --add '/Applications/Adobe Lightroom Classic/Adobe Lightroom' --no-restart
    $DOCKUTIL --add '/Applications/Adobe Illustrator 2022/Adobe' --no-restart
    $DOCKUTIL --add '/Applications/Adobe Premiere Pro 2022/Adobe Premiere Pro' --no-restart
    $DOCKUTIL --add '/Applications/Adobe Substance 3D Designer/Adobe Substance 3D' --no-restart
    $DOCKUTIL --add '/Applications/Adobe Substance 3D Painter/Adobe Substance 3D' --no-restart
    $DOCKUTIL --add '/Applications/Autodesk/maya2023/' --no-restart
    $DOCKUTIL --add '/Applications/TVPaint Animation 11.5' --no-restart
    $DOCKUTIL --add '/Applications/Corel Painter 2021/Corel Painter' --no-restart
    $DOCKUTIL --add '/Applications/' --no-restart
    $DOCKUTIL --add '/Applications' --view grid --display folder --sort name

    touch $HOME/Library/Preferences/com.ARC.docksetup.plist



defaults write tilesize -int 40
defaults write magnification -bool true

exit 0



Contributor III

I will also say, that if I run my "old" script from the desktop using terminal and sudo, it mostly works. It won't turn on magnification or shrink the dock in size. 


For the old script, the magnification  and size should work after a killall Dock command and you may have to killall cfprefsd first

$ defaults write magnification -bool true
$ killall cfprefsd                                      
$ killall Dock   



I figured out the part with size and magnification... With Monterey (and I am guessing Big Sur) you have to run those commands as the signed in user, otherwise they are run as root.

loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ {print $3 }' )
sudo -u "$loggedInUser" defaults write magnification -bool true


Still cannot get it to run at load. I thought if the plist was put into the /Library/LaunchAgent folder, it would run at load for every user. It seems that I have to put it into the one inside the English.lproj folder. I have made sure that the plist has been updated to point at the path of the such luck so far. Been working on this for a couple weeks now.


Also, why does the new script use the --add file? From the git page it seems like the old script is more correct..

  The following adds to the end of the current user's dock:
           dockutil --add /Applications/


I would think using the new script would be fine using the old scripts method for each command.

Overall, the new script should be able to be run from jamf assuming the user is logged in. 

I tested the old script and it worked for me directly with terminal, including size and magnification. 

Everything completely fails if I run zsh via terminal with the script unless i change 


That's interesting... I will play with that. 

At this point though, the old script runs as it should manually... I need to get it to run when a user signs in. That is elusive at the moment.


Hopefully this helps...

I tested this via jamf and locally, except for the defaults write... and it worked

getting it to run via the launchd is the next step.    Might be a simple permissions issue.


loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

$dockutilbin --remove all --no-restart $loggedInUserPlist; sleep 3
$dockutilbin --add /System/Applications/ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Google\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Adobe\ Bridge\ 2022/Adobe\ Bridge\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Adobe\ Photoshop\ 2022/Adobe\ Photoshop\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Adobe\ Lightroom\ Classic/Adobe\ Lightroom\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Adobe\ Illustrator\ 2022/Adobe\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Adobe\ Premiere\ Pro\ 2022/Adobe\ Premiere\ Pro\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Adobe\ Substance\ 3D\ Designer/Adobe\ Substance\ 3D\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Adobe\ Substance\ 3D\ Painter/Adobe\ Substance\ 3D\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Autodesk/maya2023/ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/TVPaint\ Animation\ 11.5\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/Corel\ Painter\ 2021/Corel\ Painter\ --no-restart $loggedInUserPlist
$dockutilbin --add /Applications/ --no-restart $loggedInUserPlist
$dockutilbin --add '/Applications/' --view grid --display folder --sort name --no-restart $loggedInUserPlist
$dockutilbin --add '~/Downloads/' --view fan --display folder --sort name --no-restart $loggedInUserPlist

defaults write /Users/$loggedInUser/Library/Preferences/ tilesize -int 40
defaults write /Users/$loggedInUser/Library/Preferences/ magnification -bool ture

sleep 4

killall cfprefsd                                      
killall Dock

exit 0


I will try that. If I can get it to run via Jamf when a user logs in for the first time, that is all I need.