kcrawford / dockutil

command line tool for managing dock items
http://patternbuffer.wordpress.com
Apache License 2.0
1.36k stars 131 forks source link

Safari Shortcut Badge Showing in macOS 13 Ventura #144

Closed rjtort closed 7 months ago

rjtort commented 1 year ago

Found when using Dockutil under Ventura that if you add /Applications/Safari.app, it adds a shortcut badge to the dock icon. Posting this to try to help anyone else who runs into this issue.

Solution I implemented to get around this below. I use an IF statement to set a Safari variable utilizing sw_vers in my script for setting the dock, then just referencing $safari when actually setting. This way I can still push to older devices if needed.

#Safari’s location changed in macOS 13 Ventura. If statement to supply the correct location based on OS version.
version=$(sw_vers -productVersion | awk -F '.' '{print $1}')
if [ $version -lt 13 ]; then
    safari=/Applications/Safari.app
    else
    safari=/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app
fi
kcrawford commented 7 months ago

This should be handled automatically in 3.1.1. Thanks for reporting the issue.