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 DP-1:~/Pictures/lockscreen_1080_1.png"
14 LOCK_CMD+=" -i eDP-1:~/Pictures/lockscreen_1080_1.png"
15 LOCK_CMD+=" -i HDMI-A-1:~/Pictures/lockscreen_1080_1.png"
16 SLEEP_CMD="systemctl suspend"
20 if [ $(pgrep -c lock.magnesium) -gt 1 ]; then
23 gpg --card-status > /dev/null
25 swaynag -m "$NAG_MSG" --type warning&
28 while [ $? -ne 2 ]; do
29 if [ $counter -gt 20 ]; then
31 swaynag -m "$NOLOCK_MSG" --type error&
36 counter=$(bc <<<"${counter}+1")
37 gpg --card-status > /dev/null