From 505acf1f0ac84f89a8525fd9f0934645235d299e Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Thu, 19 Dec 2019 23:05:38 +0000 Subject: [PATCH] Handle missing MATE directory --- roles/home-gui/tasks/mate.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/roles/home-gui/tasks/mate.yml b/roles/home-gui/tasks/mate.yml index 7327cf3..2a67fdc 100644 --- a/roles/home-gui/tasks/mate.yml +++ b/roles/home-gui/tasks/mate.yml @@ -1,4 +1,10 @@ --- +- name: Check for MATE layouts directory + stat: + path: "{{ prefix }}/share/mate-panel/layouts" + vars: + prefix: "{{ '/usr' if ansible_system == 'Linux' else '/usr/pkg' if ansible_system == 'NetBSD' else '/usr/local' }}" + register: mate_layouts - name: Copy MATE panel layout become: true template: @@ -6,25 +12,30 @@ dest: "{{ prefix }}/share/mate-panel/layouts/acp.layout" vars: prefix: "{{ '/usr' if ansible_system == 'Linux' else '/usr/pkg' if ansible_system == 'NetBSD' else '/usr/local' }}" + when: mate_layouts.stat.exists and mate_layouts.stat.isdir - name: Set default panel layout dconf: key: /org/mate/panel/general/default-layout value: "'acp'" register: layout_changed + when: ansible_system == 'Linux' - name: Reset panel command: mate-panel --reset || true - when: layout_changed.changed + when: ansible_system == 'Linux' and layout_changed.changed ignore_errors: yes changed_when: false - name: Add cities to clock applet dconf: key: /org/mate/panel/objects/clock/prefs/cities value: ['', '', '', ''] + when: ansible_system == 'Linux' - name: Set workspace switcher to two rows dconf: key: /org/mate/panel/objects/workspace-switcher/prefs/num-rows value: 2 + when: ansible_system == 'Linux' - name: Expand locations in clock dconf: key: /org/mate/panel/objects/clock/prefs/expand-locations value: 'true' + when: ansible_system == 'Linux'