Browse Source

screensaver systemd user service

master
parent
commit
b5e923cbfe
3 changed files with 24 additions and 8 deletions
  1. +13
    -7
      tasks/main.yaml
  2. +1
    -1
      templates/screensaver-start/i3lock.sh.j2
  3. +10
    -0
      templates/screensaver.service.j2

+ 13
- 7
tasks/main.yaml View File

@@ -15,13 +15,6 @@
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
@@ -42,3 +35,16 @@
dest: /usr/local/bin/screensaver-disable
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 graphical-session service
template:
src: screensaver.service.j2
dest: /etc/systemd/user/screensaver.service
mode: 0755

+ 1
- 1
templates/screensaver-start/i3lock.sh.j2 View File

@@ -2,4 +2,4 @@

/usr/local/bin/screensaver-settings

xss-lock -l -- /usr/local/bin/screensaver-lock &
exec xss-lock -l -- /usr/local/bin/screensaver-lock

+ 10
- 0
templates/screensaver.service.j2 View File

@@ -0,0 +1,10 @@
[Unit]
Description=X session reload settings
PartOf=graphical-session.target

[Service]
ExecStart=/usr/local/bin/screensaver-start
Restart=always

[Install]
WantedBy=graphical-session.target