Skip to content

Commit

Permalink
Merge pull request #17 from fubarhouse/issue/9
Browse files Browse the repository at this point in the history
PR for #9
  • Loading branch information
fubarhouse authored Oct 29, 2018
2 parents a5e7bea + 6029b8c commit b313bfd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
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

0 comments on commit b313bfd

Please sign in to comment.