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 <noreply@anthropic.com>
This commit is contained in:
parent
951ba2b850
commit
b52f730889
1 changed files with 8 additions and 0 deletions
|
|
@ -45,6 +45,14 @@
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = 3;
|
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" ''
|
ExecStart = "${pkgs.python3.withPackages (p: [])}/bin/python3 ${pkgs.writeText "macbook-dwt.py" ''
|
||||||
import glob, os, select, struct, time
|
import glob, os, select, struct, time
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue