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