Posted on 04-19-2019 10:07 PM
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
Posted on 04-20-2019 04:14 PM
Are you missing a --no-restart on the Applications folder?
Posted on 04-20-2019 05:37 PM
Might want to post here...https://github.com/kcrawford/dockutil/issues
Posted on 04-22-2019 07:18 AM
@gregdeichler That folder seems to be working fine. The downloads is the issue.
Posted on 04-22-2019 08:05 AM
I opened an issue on the github page.
Posted on 04-23-2019 06:28 AM
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.
Posted on 04-23-2019 06:32 AM
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
Posted on 04-23-2019 08:14 AM
@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.