-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear icon cache for Dock before restarting #9
Comments
I've got some ideas of how this would work, however I firmly believe it it doesn't work on 10.12.2 and 10.12.3, then we're better off with a different implementation. If you find a solution I'd be happy to draft it up. I'm doing some googling now which looks like it can work, but not reliably. Edit: The only one which reliably works appears to be the one below, which requires Recovery mode to be used.
Edit (again): This one looks to be rather easy to implement with seemingly consistent results, but is undertested - what do you think?
For that one, I would be happy to add a task in which only executes if, when and before dockutil restarts the Dock process. |
Just stumbled upon this as well, any further ideas on this? |
Last time I checked there was no 100% solution for this problem, but just hit and miss. I can have another look around, but I am open to suggestions and PR's if you feel there's an 80% or higher success rate for one implementation. |
This looks tangible, though I can't speak for backwards compatibility. I'm interested, but I'd prefer to find a non-sudo way to do this if anybody knows how. If not, I may continue to explore this soon with the use of sudo. |
I have this in an aliases file for bash:
I just perform it manually when needed. |
In checking for At which point would you ideally prefer to see caches cleared, and under which circumstances would the task be skipped (for idempotence)? |
I don't think there's any way to detect this. I always need to reboot after clearing the cache. So I'd propose to put this workaround in the documentation until somebody with more knowledge about this caching mechanism can help out :s |
Sounds good - I'll add a task either before the grunt work when changes are detected or after when no action was taken. I can have this done tonight. |
Feel free to check out branch If you're happy with the implementation let me know, and I'll get a PR in. Feedback is important, so let me know if and why it wouldn't be suitable. |
For reference: master...issue/9 The become_user part in the first changed block is not needed I think, when become: yes is added without become_user, it's always root. I'd also still add something to the documentation OR add another task to the clear cache handler that prints: please reboot if your dock icons are messed up. Otherwise: looks good, thanks! :) |
#17 Checks all the boxes here, and tests are passing. Let me know if you're happy and we'll merge! |
Well, I'm clapping my hands, so the song says I'm happy ;) |
Thanks @fubarhouse ! ;) |
No problems 👍 |
Sometimes my icon cache for dock is corrupt, giving me "weird" icons with the pencils with an A lower right. Clearing the icon cache fixes this problem. This command fixes it right now. Do you think it's worthwhile to add this, maybe with an option? If so, I'll make a PR :)
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
Solution from https://gist.github.com/fabiofl/5873100
Update: it doesn't work on a high sierra machine.
The text was updated successfully, but these errors were encountered: