Skip to content
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

PR for #9 #17

Merged
merged 9 commits into from
Oct 29, 2018
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 9 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'"
Expand All @@ -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 }}'"
Expand All @@ -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