]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Suspend machine after lock
authorMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 6 Aug 2019 12:19:34 +0000 (13:19 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 6 Aug 2019 12:19:34 +0000 (13:19 +0100)
states/sway/files/lock

index 3b01fe16b083a77a64f9423c1a02b3acc1e8ce40..f78f68545e1a2e21cadf40ce89643716561abc87 100644 (file)
@@ -5,12 +5,14 @@ Remove now to lock."
 NOLOCK_MSG="Smartcard was not removed, did not lock!"
 
 LOCK_CMD="swaylock "
+SLEEP_CMD=":"
 {% if grains['host'] == 'magnesium' %}
 LOCK_CMD+=" -i HDMI-A-2:~/Pictures/lockscreen_1080_1.png"
 LOCK_CMD+=" -i HDMI-A-3:~/Pictures/lockscreen_1080_2.png"
 {% elif grains['host'] == 'barium' %}
 LOCK_CMD+=" -i eDP-1:~/Pictures/lockscreen_1080_1.png"
 LOCK_CMD+=" -i HDMI-A-1:~/Pictures/lockscreen_1080_1.png"
+SLEEP_CMD="systemctl suspend"
 {% endif %}
 
 
@@ -35,5 +37,7 @@ else
                done
                pkill -f "$NAG_MSG"
        fi
-       $LOCK_CMD
+       $LOCK_CMD &
+       sleep 10
+       $SLEEP_CMD
 fi