summaryrefslogtreecommitdiff
path: root/example.bash
diff options
context:
space:
mode:
Diffstat (limited to 'example.bash')
-rwxr-xr-xexample.bash14
1 files changed, 14 insertions, 0 deletions
diff --git a/example.bash b/example.bash
new file mode 100755
index 0000000..970b095
--- /dev/null
+++ b/example.bash
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# acquire the inhibition
+exec 9> >(./inhibit-screensaver bash-inhibitor-example testing)
+
+# do work
+echo Working...
+sleep 10
+
+# still works if we die
+kill -9 $$
+
+# otherwise, uninhibit like so (or just exit)
+exec 9>&-