From ebbe573f95ed34bca49e24acd746950a41faa68c Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Fri, 10 Jun 2022 14:10:11 +0200 Subject: [PATCH] screenlock: Check that lock program is not running --- tree/.local/bin/screenlock.tpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tree/.local/bin/screenlock.tpl b/tree/.local/bin/screenlock.tpl index 7f37817..bdb918d 100755 --- a/tree/.local/bin/screenlock.tpl +++ b/tree/.local/bin/screenlock.tpl @@ -27,6 +27,13 @@ echo "screenlock not configured for this system" exit 1 {% end %} + +# check if lock program is running +if ps -e | grep " $LOCKPROG$"; then + echo "$LOCKPROG is already running!" + exit 1 +fi + for CMD in $OPTIONAL_CMDS; do if ! command -v "$CMD" &> /dev/null then