summaryrefslogtreecommitdiffstats
path: root/bin/suspend_after
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2018-05-09 02:58:18 +0200
committerTharre <tharre3@gmail.com>2018-05-09 17:28:13 +0200
commit321d9a8247d50cd634615ffed707aed3f4376108 (patch)
tree32fbd27e3a9e8c3f41d68232ffe203ef0ce10999 /bin/suspend_after
parent3cb67ddae1d11e4cda22b9843665b6d3775828da (diff)
downloaddotfiles-321d9a8247d50cd634615ffed707aed3f4376108.tar.gz
dotfiles-321d9a8247d50cd634615ffed707aed3f4376108.tar.xz
dotfiles-321d9a8247d50cd634615ffed707aed3f4376108.zip
Move various scripts and functions into bin/
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