summarylogtreecommitdiffstats
path: root/macbook-wakeup.service
diff options
context:
space:
mode:
Diffstat (limited to 'macbook-wakeup.service')
-rw-r--r--macbook-wakeup.service13
1 files changed, 13 insertions, 0 deletions
diff --git a/macbook-wakeup.service b/macbook-wakeup.service
new file mode 100644
index 000000000000..48ac5f514dd9
--- /dev/null
+++ b/macbook-wakeup.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Configure device events for linux-macbook
+ConditionPathExists=/proc/acpi/wakeup
+
+[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