--- /dev/null
+{% set local_bin = grains['homedir'] + '/.local/bin' %}
+
+{{ local_bin }}:
+ file.directory:
+ - user: {{ grains['user'] }}
+ - group: {{ grains['user'] }}
+ - mode: 750
+ - makedirs: True
--- /dev/null
+#!/bin/sh
+
+NAG_MSG="Smartcard is still plugged in, not locking! \
+Lock again to force locking."
+
+LOCK_CMD="swaylock "
+LOCK_CMD+=" -i HDMI-A-2:~/Pictures/lockscreen_1080_1.png"
+LOCK_CMD+=" -i HDMI-A-3:~/Pictures/lockscreen_1080_2.png"
+
+if [ $(pgrep -c lock.{{ grains['host'] }}) -gt 1 ]; then
+ pkill -f "$NAG_MSG"
+ $LOCK_CMD
+else
+ gpg --card-status > /dev/null
+ if [ $? -ne 2 ]; then
+ gpg --card-status
+ echo $?
+ swaynag -m "$NAG_MSG" --type warning
+ else
+ $LOCK_CMD
+ fi
+fi
- sway.{{ grains['os']| lower }}
- conky
- font.pango-liberation-mono
+ - local.bin
config dir:
file.directory:
- user: {{ grains['user']}}
- group: {{ grains['user']}}
- mode: 640
+
+lock script:
+ file.managed:
+ - name: {{ grains['homedir'] }}/.local/bin/lock.{{ grains['host'] }}
+ - source: {{ grains['stateroot'] }}/sway/files/lock
+ - template: jinja
+ - user: {{ grains['user'] }}
+ - group: {{ grains['user'] }}
+ - mode: 750
+
+conky launch script:
+ file.managed:
+ - name: {{ grains['homedir'] }}/.local/bin/conky-i3bar
+ - source: {{ grains['stateroot'] }}/sway/files/conky-i3bar
+ - user: {{ grains['user'] }}
+ - group: {{ grains['user'] }}
+ - mode: 750