Added draft for lid-switch

This commit is contained in:
Kevin Veen-Birkenbach 2025-04-02 01:09:39 +02:00
parent a2955a34ab
commit 5dda19cdc5
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,6 @@
---
- name: Restart systemd-logind
become: yes
systemd:
name: systemd-logind
state: restarted

View File

@ -0,0 +1,9 @@
---
- name: Set HandleLidSwitch to hibernate in /etc/systemd/logind.conf
become: yes
lineinfile:
path: /etc/systemd/logind.conf
regexp: '^#?HandleLidSwitch='
line: 'HandleLidSwitch=hibernate'
backup: yes
notify: Restart systemd-logind