From b52f7308899e75ead5fc0d3583befe60c5816c04 Mon Sep 17 00:00:00 2001 From: rope Date: Tue, 19 May 2026 17:41:42 +0100 Subject: [PATCH] macbook: re-enable touchpad when DWT service stops Add ExecStopPost to write 0 to bcm5974's inhibited sysfs node, so the touchpad is always restored even if the script is killed mid-inhibit. Co-Authored-By: Claude Opus 4.6 --- hosts/FredOS-Macbook.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hosts/FredOS-Macbook.nix b/hosts/FredOS-Macbook.nix index 81f0ec7..1216675 100644 --- a/hosts/FredOS-Macbook.nix +++ b/hosts/FredOS-Macbook.nix @@ -45,6 +45,14 @@ Type = "simple"; Restart = "on-failure"; RestartSec = 3; + ExecStopPost = pkgs.writeShellScript "dwt-uninhibit" '' + for p in /sys/class/input/event*/device/name; do + if grep -q bcm5974 "$p" 2>/dev/null; then + echo 0 > "''${p%/name}/inhibited" + fi + done + true + ''; ExecStart = "${pkgs.python3.withPackages (p: [])}/bin/python3 ${pkgs.writeText "macbook-dwt.py" '' import glob, os, select, struct, time