]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/sway/files/lock
Specify path to conky-i3bar
[max/saltfiles.git] / states / sway / files / lock
1 #!/bin/sh
2
3 NAG_MSG="Smartcard is still plugged in, not locking! \
4 Lock again to force locking."
5
6 LOCK_CMD="swaylock "
7 LOCK_CMD+=" -i HDMI-A-2:~/Pictures/lockscreen_1080_1.png"
8 LOCK_CMD+=" -i HDMI-A-3:~/Pictures/lockscreen_1080_2.png"
9
10 if [ $(pgrep -c lock.{{ grains['host'] }}) -gt 1 ]; then
11         pkill -f "$NAG_MSG" 
12         $LOCK_CMD
13 else
14         gpg --card-status > /dev/null
15         if [ $? -ne 2 ]; then
16                 gpg --card-status
17                 echo $?
18                 swaynag -m "$NAG_MSG" --type warning
19         else
20                 $LOCK_CMD
21         fi
22 fi