@@ -1,5 +1,5 @@ | |||||
--- | --- | ||||
screensaver_package: mate-screensaver | |||||
screensaver: mate-screensaver | |||||
screensaver_locktime: 10 | screensaver_locktime: 10 | ||||
screensaver_theme: screensavers-popsquares | screensaver_theme: screensavers-popsquares | ||||
screensaver_sleeptime: "{{screensaver_locktime}}" | screensaver_sleeptime: "{{screensaver_locktime}}" |
@@ -3,7 +3,28 @@ | |||||
- import_tasks: packages.yaml | - import_tasks: packages.yaml | ||||
- import_tasks: none.yaml | - import_tasks: none.yaml | ||||
when: screensaver_package == "none" | |||||
when: screensaver == 'none' | |||||
- import_tasks: screensavers/mate-screensaver.yaml | |||||
when: screensaver_package == "mate-screensaver" | |||||
- include_tasks: screensavers/{{screensaver}}.yaml | |||||
when: screensaver != 'none' | |||||
- name: screensaver settings script | |||||
template: | |||||
src: screensaver-settings.sh.j2 | |||||
dest: /usr/local/bin/screensaver-settings | |||||
mode: 0755 | |||||
when: screensaver != 'none' | |||||
- name: screensaver start script | |||||
template: | |||||
src: screensaver-start/{{screensaver}}.sh.j2 | |||||
dest: /usr/local/bin/screensaver-start | |||||
mode: 0755 | |||||
when: screensaver != 'none' | |||||
- name: screensaver lock script | |||||
template: | |||||
src: screensaver-lock/{{screensaver}}.sh.j2 | |||||
dest: /usr/local/bin/screensaver-lock | |||||
mode: 0755 | |||||
when: screensaver != 'none' |
@@ -0,0 +1,6 @@ | |||||
--- | |||||
- name: debian packages for i3lock | |||||
apt: | |||||
pkg: | |||||
- i3lock |
@@ -33,24 +33,6 @@ | |||||
dest: /usr/local/bin/mate-screensaver-helper-inhibition | dest: /usr/local/bin/mate-screensaver-helper-inhibition | ||||
mode: 0755 | 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: | - import_role: | ||||
name: dconf-lock | name: dconf-lock | ||||
vars: | vars: | ||||
@@ -0,0 +1,51 @@ | |||||
#!/bin/bash | |||||
# Example locker script -- demonstrates how to use the --transfer-sleep-lock | |||||
# option with i3lock's forking mode to delay sleep until the screen is locked. | |||||
## CONFIGURATION ############################################################## | |||||
# Options to pass to i3lock | |||||
i3lock_options="-d -c 000000" | |||||
# Run before starting the locker | |||||
pre_lock() { | |||||
#mpc pause | |||||
return | |||||
} | |||||
# Run after the locker exits | |||||
post_lock() { | |||||
return | |||||
} | |||||
############################################################################### | |||||
pre_lock | |||||
# We set a trap to kill the locker if we get killed, then start the locker and | |||||
# wait for it to exit. The waiting is not that straightforward when the locker | |||||
# forks, so we use this polling only if we have a sleep lock to deal with. | |||||
if [[ -e /dev/fd/${XSS_SLEEP_LOCK_FD:--1} ]]; then | |||||
kill_i3lock() { | |||||
pkill -xu $EUID "$@" i3lock | |||||
} | |||||
trap kill_i3lock TERM INT | |||||
# we have to make sure the locker does not inherit a copy of the lock fd | |||||
i3lock $i3lock_options {XSS_SLEEP_LOCK_FD}<&- | |||||
# now close our fd (only remaining copy) to indicate we're ready to sleep | |||||
exec {XSS_SLEEP_LOCK_FD}<&- | |||||
while kill_i3lock -0; do | |||||
sleep 0.5 | |||||
done | |||||
else | |||||
trap 'kill %%' TERM INT | |||||
i3lock -n $i3lock_options & | |||||
wait | |||||
fi | |||||
post_lock |
@@ -1,8 +0,0 @@ | |||||
#!/bin/sh | |||||
/usr/local/bin/screensaver-settings | |||||
#exec xss-lock -- i3lock -c ff00ff | |||||
#xss-lock -l -- /usr/local/bin/screensaver-lock & | |||||
exec mate-screensaver |
@@ -0,0 +1,5 @@ | |||||
#!/bin/sh | |||||
/usr/local/bin/screensaver-settings | |||||
xss-lock -l -- /usr/local/bin/screensaver-lock & |
@@ -0,0 +1,5 @@ | |||||
#!/bin/sh | |||||
/usr/local/bin/screensaver-settings | |||||
exec mate-screensaver |