瀏覽代碼

lockscreen and lockscreen-auto services

pull/1/head
父節點
當前提交
c3d6da0852
共有 4 個檔案被更改,包括 29 行新增5 行删除
  1. +6
    -0
      tasks/clean.yaml
  2. +7
    -1
      tasks/lockscreen.yaml
  3. +13
    -0
      templates/lockscreen/lockscreen-auto.service.j2
  4. +3
    -4
      templates/lockscreen/lockscreen.service.j2

+ 6
- 0
tasks/clean.yaml 查看文件

@@ -69,3 +69,9 @@
enabled: false
state: stopped
scope: user

- name: lockscreen graphical-session service disabled
systemd:
name: lockscreen.service
enabled: false
scope: user

+ 7
- 1
tasks/lockscreen.yaml 查看文件

@@ -17,7 +17,13 @@
dest: ~/.config/systemd/user/lockscreen.service
notify: systemd daemon-reload

- name: lockscreen graphical-session service enabled
- name: lockscreen-auto graphical-session service
template:
src: lockscreen/lockscreen-auto.service.j2
dest: ~/.config/systemd/user/lockscreen-auto.service
notify: systemd daemon-reload

- name: lockscreen-auto graphical-session service enabled
systemd:
name: lockscreen.service
enabled: "{{ lockscreen_enabled }}"


+ 13
- 0
templates/lockscreen/lockscreen-auto.service.j2 查看文件

@@ -0,0 +1,13 @@
{{ ansible_managed | comment }}

[Unit]
Description=Screensaver
PartOf=graphical-session.target

[Service]
Type=simple
ExecStart=/usr/bin/xss-lock -l -- systemctl --user start lockscreen.service
Restart=always

[Install]
WantedBy=graphical-session.target

+ 3
- 4
templates/lockscreen/lockscreen.service.j2 查看文件

@@ -5,11 +5,10 @@ Description=Screensaver
PartOf=graphical-session.target

[Service]
Type=simple
ExecStart=/usr/bin/xss-lock -l -- xsecurelock
Type=notify
ExecStart=xsecurelock -- systemd-notify --ready
NotifyAccess=all
EnvironmentFile=%h/.lockscreen.env
Environment="XSECURELOCK_SAVER=%h/.screensaver.sh"
Restart=always

[Install]
WantedBy=graphical-session.target