summarylogtreecommitdiffstats
path: root/macbook-wakeup.service
blob: 7f6c9b68010c231811d49ca972b737bbdb0c284b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[Unit]
Description=Configure LID-only device events for linux-macbook
ConditionPathExists=/proc/acpi/wakeup
After=suspend.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c "awk '$1 !~ /^LID/ && $3 ~ /enabled/ {print $1}' /proc/acpi/wakeup | xargs -I{} echo '{}' > /proc/acpi/wakeup"
ExecStart=/bin/sh -c "awk '$1 ~ /^LID/ && $3 ~ /disabled/ {print $1}' /proc/acpi/wakeup | xargs -I{} echo '{}' > /proc/acpi/wakeup"
RemainAfterExit=yes
TimeoutSec=0

[Install]
WantedBy=multi-user.target sleep.target