]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Update/improve locking behaviour
authorMaximilian Friedersdorff <max@friedersdorff.com>
Wed, 8 Jan 2020 10:57:56 +0000 (10:57 +0000)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Wed, 8 Jan 2020 10:57:56 +0000 (10:57 +0000)
states/sway/files/config.jinja
states/sway/files/lock

index c05fb15ee5bfdc47baaa5523d1d1e74521aa39f4..0ce972f0a12e381b6a8ec1b301dfef825f356511 100644 (file)
@@ -193,12 +193,11 @@ focus_on_window_activation urgent
 for_window [class="^rdesktop"] move workspace number 9; floating disable
 for_window [class="Pinentry"] floating enable
 
-{% set lockcmd = "swaylock -i {DP-1,eDP-1,HDMI-A-1}:~/Pictures/lockscreen_1080_1.png" %}
+{% set lockcmd = "swaylock -e -f -i ~/Pictures/lockscreen_1080_1.png" %}
 
-exec swayidle \
+exec swayidle -w \
 timeout 300 "{{lockcmd}}" \
-  timeout 600 'swaymsg "output * dpms off"' \
-    resume 'swaymsg "output * dpms on"' \
+  timeout 600 'systemctl suspend' \
     before-sleep "{{lockcmd}}"
 
 # This keyboard has this layout on all machines:
index 00ed2a83eeb91f304f21363911412a4db6cea6ce..936b955c261c5eaa930b13763ebf0979433f984d 100644 (file)
@@ -4,18 +4,7 @@ NAG_MSG="Smartcard is still plugged in, not locking! \
 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 DP-1:~/Pictures/lockscreen_1080_1.png"
-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 %}
-
+LOCK_CMD="systemctl suspend"
 
 if [ $(pgrep -c lock.magnesium) -gt 1 ]; then
        exit
@@ -38,7 +27,5 @@ else
                done
                pkill -f "$NAG_MSG"
        fi
-       $LOCK_CMD &
-       sleep 10
-       $SLEEP_CMD
+       $LOCK_CMD
 fi