Skip to content

Commit

Permalink
Merge pull request geerlingguy#55 from Maddog2050/fix-recent-apps-issue
Browse files Browse the repository at this point in the history
Application doesn't get added to dock if it's in your recent items
  • Loading branch information
geerlingguy authored Aug 19, 2022
2 parents f390c30 + 36a1d10 commit 4c9b5a5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions roles/dock/tasks/dock-add.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
changed_when: false
tags: ['dock']

- name: Get current dock section from output.
set_fact:
current_section: "{{ dockitem_exists.stdout | regex_replace('^.*was found in (.*) at slot.*$', '\\1') }}"
when: dockitem_exists.rc == 0
tags: ['dock']

- name: Ensure Dock item {{ item.name | default(item) }} exists.
ansible.builtin.command: "dockutil --add '{{ item.path }}'"
when: dockitem_exists.rc >0
when: dockitem_exists.rc >0 or
dockitem_exists.rc == 0 and current_section == 'recent-apps'
tags: ['dock']

- name: Pause for 7 seconds between dock changes.
ansible.builtin.pause:
seconds: 7
when: dockitem_exists.rc >0
when: dockitem_exists.rc >0 or
dockitem_exists.rc == 0 and current_section == 'recent-apps'
tags: ['dock']

0 comments on commit 4c9b5a5

Please sign in to comment.