Correctly configure sleep and hibernation
This commit is contained in:
parent
cfd2b9be69
commit
142ccb8815
4 changed files with 22 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
[Login]
|
||||
HandleLidSwitch=suspend-then-hibernate
|
|
@ -0,0 +1,2 @@
|
|||
[Sleep]
|
||||
HibernateDelaySec=15min
|
|
@ -23,6 +23,18 @@
|
|||
- "/usr/bin/systemctl reboot"
|
||||
- "/usr/bin/systemctl suspend"
|
||||
|
||||
- name: Copy sleep and hibernation config drop-ins for systemd on mobile platforms
|
||||
become: yes
|
||||
copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
loop:
|
||||
- src: "{{ role_path }}/files/systemd/logind.conf.d"
|
||||
dest: "/etc/systemd/"
|
||||
- src: "{{ role_path }}/files/systemd/sleep.conf.d"
|
||||
dest: "/etc/systemd/"
|
||||
when: hostvars[ansible_hostname]['mobile_platform']
|
||||
|
||||
- name: Copy static config files
|
||||
copy:
|
||||
src: "{{ item.src }}"
|
||||
|
@ -34,6 +46,10 @@
|
|||
dest: "{{ ansible_env.HOME }}/"
|
||||
- src: "{{ role_path }}/files/.zshrc"
|
||||
dest: "{{ ansible_env.HOME }}/"
|
||||
- src: "{{ role_path }}/files/systemd/logind.conf.d"
|
||||
dest: "/etc/systemd/"
|
||||
- src: "{{ role_path }}/files/systemd/sleep.conf.d"
|
||||
dest: "/etc/systemd/"
|
||||
|
||||
- name: Ensure presence of required directories
|
||||
file:
|
||||
|
|
|
@ -14,7 +14,8 @@ idle() {
|
|||
swayidle -w \
|
||||
timeout 180 '~/.local/bin/hyprhelpr lock' \
|
||||
timeout 240 'hyprctl dispatch dpms off' \
|
||||
resume 'hyprctl dispatch dpms on'
|
||||
resume 'hyprctl dispatch dpms on' \
|
||||
before-sleep '~/.local/bin/hyprhelpr lock'
|
||||
}
|
||||
|
||||
lock() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue