From eddb48e461f806faa633c27c1f65e6a57f020d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:15:01 +0100 Subject: [PATCH] Disable power button Oh I didn't commit this, probably why I still have the problem on the Pinebook x) --- config/automatrop/roles/system/handlers/main.yaml | 5 +++++ config/automatrop/roles/system/tasks/main.yml | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/config/automatrop/roles/system/handlers/main.yaml b/config/automatrop/roles/system/handlers/main.yaml index b7065d7..595a97f 100644 --- a/config/automatrop/roles/system/handlers/main.yaml +++ b/config/automatrop/roles/system/handlers/main.yaml @@ -39,3 +39,8 @@ debug: msg: "The Panfrost display driver configuration was changed, but needs a reboot to be applied." listen: panfrost config changed + +- name: Reload systemd-logind + command: systemctl kill -s HUP systemd-logind + become: yes + listen: systemd-logind config changed diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml index 262ff40..aade07b 100644 --- a/config/automatrop/roles/system/tasks/main.yml +++ b/config/automatrop/roles/system/tasks/main.yml @@ -356,6 +356,19 @@ - etc changed - systemd changed +- name: Disable power button + lineinfile: + path: /etc/systemd/logind.conf + line: 'HandlePowerKey=ignore' + regexp: '^#? *HandlePowerKey=' + insertafter: '^\[Login\]$' + become: yes + notify: systemd-logind config changed + # Reason: I sometimes press it accidentally + # (hoping to start it when it's already started, + # or really accidentally on the Pinebook). + # Suspend would be nice, but it doesn't have the locker then + # TODO Hibernation, if that's relevant # $ sudo blkid | grep 'TYPE="swap"' # $ sudoedit /etc/default/grub