summaryrefslogtreecommitdiffstats
path: root/desktop-xfce4/tasks/main.yml
blob: ac78a136eeac51001a8e335c8104693a774a28e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
- name: Install XFCE4 desktop environment
  apt:
    name: "{{ xfce_packages }}"
    state: present
    install_recommends: no
  vars:
    xfce_packages:
      - evince
      - mousepad
      - ristretto
      - xfce4
      - xfce4-terminal
      - xfce4-goodies
      - xfce4-power-manager
      - xubuntu-icon-theme
      - greybird-gtk-theme
      - pavucontrol
      - pulseaudio
      - udisks2
      - gvfs
      - gvfs-backends
      - gvfs-fuse
      # for xml module
      - python3-lxml

# TODO: do this the proper way, when it is known how :)
- name: HACK overwrite default wallpaper
  find:
    paths: /usr/share/backgrounds/xfce
    patterns: "*"
  register: xfce_backgrounds

- name: HACK overwrite default wallpaper
  file:
    path: "{{ item.path }}"
    state: absent
  with_items: "{{ xfce_backgrounds.files }}"

- name: HACK overwrite default wallpaper
  file:
    src: /usr/share/backgrounds/bwlp-1920x1080.png
    dest: "{{ item.path }}"
    state: link
    force: yes
  with_items: "{{ xfce_backgrounds.files }}"

- name: Cleanup applications menu
  file:
    path: "{{ item }}"
    state: absent
  with_items:
    - /usr/share/applications/exo-mail-reader.desktop
    - /usr/share/applications/assistant-qt5.desktop
    - /usr/share/applications/designer-qt5.desktop
    - /usr/share/applications/linguist-qt5.desktop
    - /usr/share/applications/globaltime.desktop
    - /usr/share/applications/xfcalendar.desktop

- name: Copy distro's specific static files
  copy:
    src: "files/{{ ansible_distribution_version }}/"
    dest: /
  become: yes

# disable logout menu items
- name: Configure xfce4 logout menu | probe shutdown node
  xml:
    path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
    xpath: /channel/property[@name='shutdown']
    count: yes
  register: shutdown_nodes

- name: Configure xfce4 logout menu | check shutdown node
  debug:
    var: shutdown_nodes.count

- name: Configure xfce4 logout menu | add shutdown node if missing
  xml:
    path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
    xpath: /channel
    add_children:
      - property:
          name: "shutdown"
          type: "empty"
    pretty_print: yes
  when: shutdown_nodes.count == 0

- name: Configure xfce4 logout menu | disable suspend and hibernate
  xml:
    path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
    xpath: /channel/property[@name='shutdown']
    add_children:
      - property:
          name: "ShowSuspend"
          type: "bool"
          value: "false"
      - property:
          name: "ShowHibernate"
          type: "bool"
          value: "false"
    pretty_print: yes
  when: shutdown_nodes.count == 0