From 93c9f6cfbb52fb19e94b7d1693e75e537a69203c Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Mon, 8 Jul 2024 11:06:40 +0200 Subject: [PATCH] feat: add default browser role --- ansible/roles/xdg_browser/tasks/main.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ansible/roles/xdg_browser/tasks/main.yaml diff --git a/ansible/roles/xdg_browser/tasks/main.yaml b/ansible/roles/xdg_browser/tasks/main.yaml new file mode 100644 index 0000000..4c51785 --- /dev/null +++ b/ansible/roles/xdg_browser/tasks/main.yaml @@ -0,0 +1,12 @@ +- name: Get data about default Xdg browse + ansible.builtin.command: xdg-settings get default-web-browser + register: xdg_browser + changed_when: false + +- name: Print desktop entry (IQ9202410) + debug: + msg: "{{ xdg_browser }} {{ xdg_browser.stdout }} {{ default_browser }}" + +- name: Set default Xdg browser + when: "xdg_browser.stdout != default_browser + '.desktop'" + ansible.builtin.command: "xdg-settings set default-web-browser {{ default_browser }}.desktop"