summaryrefslogtreecommitdiff
path: root/example.bash
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2017-08-16 20:36:09 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2017-08-16 20:36:09 -0400
commitcf89b3457feaa7f7695fc992d25473f773423008 (patch)
tree0938e816cc26f6d68192f77d2ad90daec77d14b1 /example.bash
downloadinhibit-screensaver-cf89b3457feaa7f7695fc992d25473f773423008.tar.xz
inhibit-screensaver-cf89b3457feaa7f7695fc992d25473f773423008.zip
Initial commit
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>&-