Browse Source

mate-screensaver

master
parent
commit
a4f6caa83f
6 changed files with 99 additions and 70 deletions
  1. +1
    -0
      defaults/main.yaml
  2. +5
    -70
      tasks/main.yaml
  3. +9
    -0
      tasks/none.yaml
  4. +1
    -0
      tasks/packages.yaml
  5. +74
    -0
      tasks/screensavers/mate-screensaver.yaml
  6. +9
    -0
      vars/main.yaml

+ 1
- 0
defaults/main.yaml View File

@@ -1,4 +1,5 @@
---
screensaver_package: mate-screensaver
screensaver_locktime: 10
screensaver_theme: screensavers-popsquares
screensaver_sleeptime: "{{screensaver_locktime}}"

+ 5
- 70
tasks/main.yaml View File

@@ -1,74 +1,9 @@
---

- name: ensure old screensavers are absent
apt:
pkg:
- light-locker
- xscreensaver
state: absent
- import_tasks: packages.yaml

- name: install required debian packages
apt:
pkg:
- mate-screensaver
- xscreensaver-gl
- python3
- mate-power-manager
- xautolock
- xss-lock
- xbacklight
- i3lock
- import_tasks: none.yaml
when: screensaver_package == "none"

- name: gdmflexiserver dummy script
copy:
src: gdmflexiserver-fake.sh
dest: /usr/local/bin/gdmflexiserver
mode: 0755

# Bug: https://github.com/mate-desktop/mate-screensaver/issues/57
# https://gist.github.com/alexander255/9b991816418e4e60ee7c
- name: mate-screensaver-helper-inhibition script
copy:
src: mate-screensaver-helper-inhibition.py
dest: /usr/local/bin/mate-screensaver-helper-inhibition
mode: 0755

- name: screensaver settings script
template:
src: screensaver-settings.sh.j2
dest: /usr/local/bin/screensaver-settings
mode: 0755

- name: screensaver start script
template:
src: screensaver-start.sh.j2
dest: /usr/local/bin/screensaver-start
mode: 0755

- name: screensaver lock script
template:
src: screensaver-lock.sh.j2
dest: /usr/local/bin/screensaver-lock
mode: 0755

- import_role:
name: dconf-lock
vars:
dconf_lock_id: screensaver
dconf_lock_settings:
/org/mate/screensaver:
idle-activation-enabled: 'true'
lock-enabled: 'true'
mode: "'single'"
themes: "['{{screensaver_theme}}']"
/org/mate/desktop/session:
idle-delay: "{{ screensaver_locktime | int }}"
/org/mate/power-manager:
sleep-display-ac: "{{ screensaver_sleeptime | int * 60 }}"
dconf_lock_paths:
- /org/mate/desktop/session/idle-delay
- /org/mate/screensaver/idle-activation-enabled
- /org/mate/screensaver/lock-enabled
- /org/mate/screensaver/mode
- /org/mate/screensaver/themes
- /org/mate/power-manager/sleep-display-ac
- import_tasks: screensavers/mate-screensaver.yaml
when: screensaver_package == "mate-screensaver"

+ 9
- 0
tasks/none.yaml View File

@@ -0,0 +1,9 @@
---

- name: delete all screensaver packages
apt:
pkg:
- light-locker
- xscreensaver
- mate-screensaver
state: absent

+ 1
- 0
tasks/packages.yaml View File

@@ -0,0 +1 @@
---

+ 74
- 0
tasks/screensavers/mate-screensaver.yaml View File

@@ -0,0 +1,74 @@
---

- name: ensure old screensavers are absent
apt:
pkg:
- light-locker
- xscreensaver
state: absent

- name: install required debian packages
apt:
pkg:
- mate-screensaver
- xscreensaver-gl
- python3
- mate-power-manager
- xautolock
- xss-lock
- xbacklight
- i3lock

- name: gdmflexiserver dummy script
copy:
src: gdmflexiserver-fake.sh
dest: /usr/local/bin/gdmflexiserver
mode: 0755

# Bug: https://github.com/mate-desktop/mate-screensaver/issues/57
# https://gist.github.com/alexander255/9b991816418e4e60ee7c
- name: mate-screensaver-helper-inhibition script
copy:
src: mate-screensaver-helper-inhibition.py
dest: /usr/local/bin/mate-screensaver-helper-inhibition
mode: 0755

- name: screensaver settings script
template:
src: screensaver-settings.sh.j2
dest: /usr/local/bin/screensaver-settings
mode: 0755

- name: screensaver start script
template:
src: screensaver-start.sh.j2
dest: /usr/local/bin/screensaver-start
mode: 0755

- name: screensaver lock script
template:
src: screensaver-lock.sh.j2
dest: /usr/local/bin/screensaver-lock
mode: 0755

- import_role:
name: dconf-lock
vars:
dconf_lock_id: screensaver
dconf_lock_settings:
/org/mate/screensaver:
idle-activation-enabled: 'true'
lock-enabled: 'true'
mode: "'single'"
themes: "['{{screensaver_theme}}']"
/org/mate/desktop/session:
idle-delay: "{{ screensaver_locktime | int }}"
/org/mate/power-manager:
sleep-display-ac: "{{ screensaver_sleeptime | int * 60 }}"
dconf_lock_paths:
- /org/mate/desktop/session/idle-delay
- /org/mate/screensaver/idle-activation-enabled
- /org/mate/screensaver/lock-enabled
- /org/mate/screensaver/mode
- /org/mate/screensaver/themes
- /org/mate/power-manager/sleep-display-ac

+ 9
- 0
vars/main.yaml View File

@@ -1 +1,10 @@
---


screensaver_debian_packages:
mate-screensaver:
- mate-screensaver
light-locker:
- light-locker
xscreensaver:
- xscreensaver