Closed remy-tiitre closed 3 years ago
same issue here. dockutil still functions on 11.3.1 but 11.4 is broken.
I have the same observation, it can by bug in macOS but we should consider new macOS behavior from version 11.4. Can anybody make test on macOS 11.5 beta for bug or behavior change confirmation?
I can confirm that this is not happening with Big Sur 11.5 beta 2
@rodchristiansen Thank you, so confirmed as bug in macOS 11.4.
I created a workaround for now using PlistBuddy.
loggedInUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
/usr/libexec/PlistBuddy -c "Set :persistent-others:<folder_order_in_array>:tile-data:displayas 1" "/Users/${loggedInUser}/Library/Preferences/com.apple.dock.plist"
Hi @cnelson644
I need a solid 15 seconds PlistBuddy to not fail with Set: Entry, ":persistent-others:0:tile-data:displayas", Does Not Exist
. Any idea on what takes so long?
Also, the changes only occur if I do killall Dock
afterwards, so there's 2 mandatory updates necessary (once for dockutil and once for PlistBuddy). If I skip either one, the dock doesn't get updated.
@sebastienkb I think it has to do with the Dock not being fully loaded. I added this to the beginning of the loop to help with that.
while ! /usr/libexec/PlistBuddy -c "Print :persistent-others:${counter}:tile-data:displayas" "/Users/${loggedInUser}/Library/Preferences/com.apple.dock.plist"
sleep .5
done
It will just loop until the Dock is ready.
And yes you do have to add a killall Dock
afterward. It's not the best solution but it gets the job done.
I was looking through the script's source code and found the problem: For adding directories, dockutil does a version check, and only checks the second part of the version, specifically for whether that version matches "4" (so, 10.4). MacOS Big Sur reports version number "11.4" - and so dockutil adds folders as if it was running on OS X Tiger, all the way back in 2005.
You can find a fix in #105 (validated on my macOS Big Sur install), and hopefully you find this as funny as I did, once I understood what's going on (:
After latest Big Sur update these options do not work anymore
Folders are always added with Stack and Automatic options.