summaryrefslogtreecommitdiff
path: root/example.bash
blob: 970b095d40a1a0579711a2832779735f480e6a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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>&-