From 95ed02d396729000c17752ca9084d3f705da0f94 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Tue, 14 May 2019 12:54:45 +0100 Subject: [PATCH] Test for ret status of 2 with gpg --card-status Bourne shell seems to only accept 1 as truthy --- sway/.local/bin/lock.magnesium | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sway/.local/bin/lock.magnesium b/sway/.local/bin/lock.magnesium index 6861b9a..b7cbe89 100755 --- a/sway/.local/bin/lock.magnesium +++ b/sway/.local/bin/lock.magnesium @@ -10,8 +10,13 @@ LOCK_CMD+=" -i HDMI-A-3:~/Pictures/lockscreen_1080_2.png" if [ $(pgrep -c lock.${HOSTNAME}) -gt 1 ]; then pkill -f "$NAG_MSG" $LOCK_CMD -elif gpg --card-status >/dev/null 2&>1; then - swaynag -m "$NAG_MSG" --type warning else - $LOCK_CMD + gpg --card-status > /dev/null + if [ $? -ne 2 ]; then + gpg --card-status + echo $? + swaynag -m "$NAG_MSG" --type warning + else + $LOCK_CMD + fi fi -- 2.46.2