From 9e7e1bc64fbeb7bcaea46c0a6f07dba6342e670e Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Sun, 13 Oct 2019 22:46:15 +0100 Subject: [PATCH] Fix for FreeBSD --- roles/home/tasks/mate.yml | 15 +++++++-------- roles/home/{files => templates}/mate-acp.layout | 8 ++++---- 2 files changed, 11 insertions(+), 12 deletions(-) rename roles/home/{files => templates}/mate-acp.layout (79%) diff --git a/roles/home/tasks/mate.yml b/roles/home/tasks/mate.yml index cf66d83..335661c 100644 --- a/roles/home/tasks/mate.yml +++ b/roles/home/tasks/mate.yml @@ -1,11 +1,11 @@ --- - name: Copy MATE panel layout become: true - copy: + template: src: mate-acp.layout dest: "{{ prefix }}/share/mate-panel/layouts/acp.layout" vars: - prefix: "{{ '/usr/local' if ansible_distribution == 'FreeBSD' else '/usr' }}" + prefix: "{{ '/usr' if ansible_system == 'Linux' else '/usr/local' }}" - name: Detect running mate-panel process pids: name: mate-panel @@ -15,24 +15,23 @@ key: /org/mate/panel/general/default-layout value: "'acp'" register: layout_changed - when: mate_panel.pids | length > 0 + when: mate_panel.pids | length > 0 and ansible_system == 'Linux' - name: Reset panel command: mate-panel --reset || true - when: layout_changed.changed and mate_panel.pids | length > 0 - ignore_errors: yes + when: layout_changed.changed and mate_panel.pids | length > 0 and ansible_system == 'Linux' changed_when: false - name: Add cities to clock applet dconf: key: /org/mate/panel/objects/clock/prefs/cities value: ['', '', '', ''] - when: mate_panel.pids | length > 0 + when: mate_panel.pids | length > 0 and ansible_system == 'Linux' - name: Set workspace switcher to two rows dconf: key: /org/mate/panel/objects/workspace-switcher/prefs/num-rows value: 2 - when: mate_panel.pids | length > 0 + when: mate_panel.pids | length > 0 and ansible_system == 'Linux' - name: Expand locations in clock dconf: key: /org/mate/panel/objects/clock/prefs/expand-locations value: 'true' - when: mate_panel.pids | length > 0 + when: mate_panel.pids | length > 0 and ansible_system == 'Linux' diff --git a/roles/home/files/mate-acp.layout b/roles/home/templates/mate-acp.layout similarity index 79% rename from roles/home/files/mate-acp.layout rename to roles/home/templates/mate-acp.layout index 5c6970d..dbfa5cd 100644 --- a/roles/home/files/mate-acp.layout +++ b/roles/home/templates/mate-acp.layout @@ -11,28 +11,28 @@ locked=true [Object terminal] object-type=launcher -launcher-location=/usr/share/applications/mate-terminal.desktop +launcher-location={{ prefix }}/share/applications/mate-terminal.desktop toplevel-id=top position=10 locked=true [Object file-browser] object-type=launcher -launcher-location=/usr/share/applications/caja-browser.desktop +launcher-location={{ prefix }}/share/applications/caja-browser.desktop toplevel-id=top position=20 locked=true [Object text-editor] object-type=launcher -launcher-location=/usr/share/applications/gvim.desktop +launcher-location={{ prefix }}/share/applications/gvim.desktop toplevel-id=top position=30 locked=true [Object web-browser] object-type=launcher -launcher-location=/usr/share/applications/firefox-esr.desktop +launcher-location={{ prefix }}/share/applications/firefox-esr.desktop toplevel-id=top position=40 locked=true