瀏覽代碼

lockscreen dpms

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

+ 6
- 5
tasks/lockscreen.yaml 查看文件

@@ -11,20 +11,21 @@
dest: ~/.screensaver.sh
mode: 0755

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

- name: lockscreen-auto graphical-session service
- name: lockscreen-auto graphical-session service definition
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
- name: lockscreen-auto graphical-session service
systemd:
name: lockscreen.service
enabled: "{{ lockscreen_enabled }}"
name: lockscreen-auto.service
enabled: "{{ lockscreen_auto_enabled }}"
state: "{{ lockscreen_auto_enabled | ternary('started','stopped') }}"
scope: user

+ 2
- 2
templates/i3/i3.config.j2 查看文件

@@ -200,8 +200,8 @@ mode "session" {
bindsym l exec --no-startup-id {{lockscreen_lock_command}}; mode "default"; {{on_focus_workspace}}
bindcode 49 exec --no-startup-id {{lockscreen_lock_command}}; mode "default"; {{on_focus_workspace}}
bindsym b exec --no-startup-id xsetroot -solid black; mode "default"; {{on_focus_workspace}}
bindsym e exec --no-startup-id systemctl --user start lockscreen.service; mode "default"; {{on_focus_workspace}}
bindsym d exec --no-startup-id systemctl --user stop lockscreen.service; mode "default"; {{on_focus_workspace}}
bindsym e exec --no-startup-id xset s on; exec --no-startup-id xset dpms {{ display_sleeptime | int }} {{ display_sleeptime | int }} {{ display_sleeptime | int }}; mode "default"; {{on_focus_workspace}}
bindsym d exec --no-startup-id xset s off; exec --no-startup-id xset dpms 0 0 0; mode "default"; {{on_focus_workspace}}
bindsym Shift+R exec --no-startup-id {{system_reboot_command}}; mode "default"; {{on_focus_workspace}}
bindsym Shift+P exec --no-startup-id {{system_poweroff_command}}; mode "default"; {{on_focus_workspace}}



+ 1
- 0
templates/lockscreen/lockscreen.env.j2 查看文件

@@ -1,5 +1,6 @@
{{ ansible_managed | comment }}

#XSECURELOCK_SAVER=$HOME/.screensaver.sh
XSECURELOCK_AUTH_BACKGROUND_COLOR={{home_base_color_hue|hsv2rgb(66,47)}}
XSECURELOCK_SWITCH_USER_COMMAND=dm-tool switch-to-greeter
XSECURELOCK_AUTH_TIMEOUT=5

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

@@ -7,8 +7,10 @@ PartOf=graphical-session.target
[Service]
Type=notify
ExecStart=xsecurelock -- systemd-notify --ready
ExecStartPost=xset dpms $XSECURELOCK_AUTH_TIMEOUT $XSECURELOCK_AUTH_TIMEOUT $XSECURELOCK_AUTH_TIMEOUT
NotifyAccess=all
EnvironmentFile=%h/.lockscreen.env
ExecStopPost=xset dpms {{ display_sleeptime | int }} {{ display_sleeptime | int }} {{ display_sleeptime | int }}

[Install]
WantedBy=graphical-session.target