3 NAG_MSG="Smartcard is still plugged in, not locking! \
5 NOLOCK_MSG="Smartcard was not removed, did not lock!"
9 {% if grains['host'] == 'magnesium' %}
10 LOCK_CMD+=" -i HDMI-A-2:~/Pictures/lockscreen_1080_1.png"
11 LOCK_CMD+=" -i HDMI-A-3:~/Pictures/lockscreen_1080_2.png"
12 {% elif grains['host'] == 'barium' %}
13 LOCK_CMD+=" -i eDP-1:~/Pictures/lockscreen_1080_1.png"
14 LOCK_CMD+=" -i HDMI-A-1:~/Pictures/lockscreen_1080_1.png"
15 SLEEP_CMD="systemctl suspend"
19 if [ $(pgrep -c lock.magnesium) -gt 1 ]; then
22 gpg --card-status > /dev/null
24 swaynag -m "$NAG_MSG" --type warning&
27 while [ $? -ne 2 ]; do
28 if [ $counter -gt 20 ]; then
30 swaynag -m "$NOLOCK_MSG" --type error&
35 counter=$(bc <<<"${counter}+1")
36 gpg --card-status > /dev/null