Skip to main content
Question

dockutil on 10.14

  • April 20, 2019
  • 7 replies
  • 35 views

KyleEricson
Forum|alt.badge.img+17

Maybe this isn't fully supported, but the icon for the user's downloads doesn't seem to work with dockutil on macOS 10.14. It's just showing as a question mark. If I right click this icon and change it to a Stack then back to Folder the icon then works.

Full script:

#!/bin/bash

echo "running dockutil"
DOCKUTIL=/usr/local/bin/dockutil
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 + "
");')

echo "remove default apps"
# remove default apps 
$DOCKUTIL --remove all --no-restart --allhomes
echo "adding to dock"
# add items to dock
$DOCKUTIL --add /Applications/Google Chrome.app --position 1 --no-restart --allhomes
$DOCKUTIL --add /Applications/zoom.us.app --after "Google Chrome" --no-restart --allhomes
$DOCKUTIL --add /Applications/Slack.app --after zoom.us --no-restart --allhomes
$DOCKUTIL --add /Applications/Self Service.app --after Slack --no-restart --allhomes
$DOCKUTIL --add '/Applications/System Preferences.app' --after "Slack" --no-restart --allhomes

$DOCKUTIL --add '/Applications' --view grid --display folder --sort name  --section others --position 1 --allhomes
$DOCKUTIL --add '~/Downloads' --view list --display folder --sort dateadded --section others --position end --allhomes

exit 0

7 replies

Forum|alt.badge.img+1
  • New Contributor
  • April 20, 2019

Are you missing a --no-restart on the Applications folder?


donmontalvo
Forum|alt.badge.img+36
  • Hall of Fame
  • April 21, 2019

KyleEricson
Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • April 22, 2019

@gregdeichler That folder seems to be working fine. The downloads is the issue.


KyleEricson
Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • April 22, 2019

I opened an issue on the github page.


Forum|alt.badge.img+19
  • Contributor
  • April 23, 2019

Maybe the downloads folder is not working because that command is occurring as the dock is being restarted, due to the dock being restarted immediately after the /Applications folder is set (missing --no-restart in that line). Maybe you can do a --no-restart at the end of all of the dockutil lines and just do a killall Dock at the end.


Forum|alt.badge.img+7

I guess the issue is due you trying to apply to all Homes. Here is what we are using.

#!/bin/bash

    currentuser=$(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 + "
");')
    dockutil="/usr/local/bin/dockutil"


        # Remove all
        su -l "${currentuser}" -c "${dockutil} --remove all --no-restart"


        # Add applications
        su -l "${currentuser}" -c "${dockutil} --add '/Applications/Safari.app' --no-restart"
        su -l "${currentuser}" -c "${dockutil} --add '/Applications/Firefox.app' --no-restart"


        # Add folders
        su -l "${currentuser}" -c "${dockutil} --add '/Applications/Lernprogramme/ Lernprogramme starten' --view grid --display folder --no-restart"
        su -l "${currentuser}" -c "${dockutil} --add '/Applications' --view grid --display folder --no-restart"
        su -l "${currentuser}" -c "${dockutil} --add '~/Downloads' --view grid --display folder --no-restart"

        # Kill dock
        su -l "${currentuser}" -c "killall Dock"


exit 0

KyleEricson
Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • April 23, 2019

@claudiogardini I tried your script and it didn't do anything. I did change mine with the --no-restart option and that seemed to fix my issue.