Przeglądaj źródła

lockscreen dpms

pull/1/head
rodzic
commit
be2b8c363c
4 zmienionych plików z 11 dodań i 7 usunięć
  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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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