# ---------------------------------------------------------------------------- #
## \author Sebastien Beaugrand
## \sa http://beaugrand.chez.com/
## \copyright CeCILL 2.1 Free Software license
# ---------------------------------------------------------------------------- #
---
- name: copy default panel
  copy:
    src: /etc/xdg/lxpanel/default/panels/panel
    dest: "{{ home }}/.config/lxpanel/LXDE/panels/panel"
    force: no
  notify:
    - lxpanelctl restart

- name: suppr launchbar spaces
  lineinfile:
    path: "{{ home }}/.config/lxpanel/LXDE/panels/panel"
    regexp: '    type = launchbar'
    line: '  type=launchbar'

- name: suppr pager spaces
  lineinfile:
    path: "{{ home }}/.config/lxpanel/LXDE/panels/panel"
    regexp: '    type = pager'
    line: '  type=pager'

- name: launchbar
  blockinfile:
    path: "{{ home }}/.config/lxpanel/LXDE/panels/panel"
    marker: "{mark}"
    marker_begin: '  type=launchbar'
    marker_end: '  type=pager'
    block: |
      # {
        Config {
          Button {
            id=screen.desktop
          }
          Button {
            id=firefox-esr.desktop
          }
          Button {
            id=emacs.desktop
          }
          Button {
            id=thunar.desktop
          }
        }
      }
      Plugin {
  notify:
    - lxpanelctl restart

- name: autohide
  lineinfile:
    path: "{{ home }}/.config/lxpanel/LXDE/panels/panel"
    insertafter: 'height='
    regexp: 'autohide='
    line: '  autohide=1'
  notify:
    - lxpanelctl restart