kcrawford / dockutil

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

Dockutil does not restart Dock macOS 11.6.5 Big Sur and 12.6.3 Monterey #133

Closed ferben closed 1 year ago

ferben commented 2 years ago

Reproduce:

$ ./dockutil --add "/Applications/Fork.app" --section others
adding /Applications/Fork.app
Could not kickstart service "com.apple.Dock.agent": 125: Domain does not support specified action

after command killall Dock item appear in dock.

This bug appear on macOS 11.6.5 Big Sur, macOS 12.3.1 is OK.

ferben commented 1 year ago

This appear on macOS 12.6.3 too (macMini M1).

ferben commented 1 year ago

Root cause: Issue appear under user "Developer" with home "/Users/dev".

Under this user function SCDynamicStoreCopyConsoleUser() return username "loginwindow" so it leads to skip Dock restart.

ferben commented 1 year ago

It is a really strange bug because conditions for reproduction is not fully clear. But root cause is known. In suggested commit it was solved by fallback to call POSIX function getuid(). Unfortunately I withdraw pull-request because I can no more verify if it really helps. If anybody want test binary I can build in my forked project separately.