summaryrefslogtreecommitdiffstats
path: root/bin/suspend_after
diff options
context:
space:
mode:
Diffstat (limited to 'bin/suspend_after')
-rwxr-xr-xbin/suspend_after6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/suspend_after b/bin/suspend_after
new file mode 100755
index 0000000..5f6cce4
--- /dev/null
+++ b/bin/suspend_after
@@ -0,0 +1,6 @@
+#!/bin/bash -e
+
+trap 'kill $!' INT TERM EXIT
+systemd-inhibit --what=handle-lid-switch sleep 1d &
+eval "$*"
+systemctl suspend