diff options
-rwxr-xr-x | screen-locker.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/screen-locker.sh b/screen-locker.sh index 51b6110..b1fb594 100755 --- a/screen-locker.sh +++ b/screen-locker.sh @@ -1,5 +1,12 @@ #!/bin/bash +lock="$HOME/.screen-locker.lck" +exec 9>"${lock}" +if ! flock -n 9; then + logger "screen locker lock already locked" + exit +fi + if pidof i3lock &> /dev/null; then exit 1; fi revert() { |