diff --git a/README.md b/README.md index f452b5f..f405fab 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Install [Dockutil](https://github.com/kcrawford/dockutil) and remove, add and and rotate items on OSX's dock on macOS. +During the roles execution, icon cache will also be cleared however may require a restart if there are continuing problems. + ## Requirements None. diff --git a/handlers/main.yml b/handlers/main.yml index 8992704..e70fb97 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,5 +1,14 @@ --- # handlers file for fubarhouse.macdock + +- name: clear cache + become: yes + shell: "{{ item }}" + with_items: + - 'find /private/var/folders/ -name com.apple.iconservices -exec rm -rf {} \; | true' + - 'find /private/var/folders/ -name com.apple.dock.iconcache -exec rm -rf {} \; | true' + - 'rm -rf /Library/Caches/com.apple.iconservices.store | true' + - name: restart dock shell: "/usr/bin/killall Dock" failed_when: false diff --git a/tasks/main.yml b/tasks/main.yml index 54b806e..8ab11b8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -34,7 +34,9 @@ when: - dockitems_remove_all|bool == false - (item.item ~ " was found in persistent-apps") in item.stdout - notify: restart dock + notify: + - clear cache + - restart dock - name: Dockutil | Get information on configured setup shell: "{{ dockutil_install_path }} --find '{{ item.name }}'" @@ -50,7 +52,9 @@ loop_control: label: "{{item.item}}" when: (item.item.name ~ " was not found in") in item.stdout - notify: restart dock + notify: + - clear cache + - restart dock - name: Dockutil | Get information on current setup shell: "{{ dockutil_install_path }} --find '{{ item.name }}'" @@ -68,4 +72,6 @@ when: - (item.item.name ~ " was found in persistent-apps at slot " ~ item.item.pos ~ " in") not in item.stdout - (item.item.name ~ " was not found") not in item.stdout - notify: restart dock + notify: + - clear cache + - restart dock