From 9afc6cf410cf16d9bbd0a7de8716c2b6d2e55c7b Mon Sep 17 00:00:00 2001 From: surtur Date: Thu, 11 Jun 2020 23:04:14 +0200 Subject: [PATCH] add: another, better swaylock-wrapper --- bin/swaylock-wrapper | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/swaylock-wrapper diff --git a/bin/swaylock-wrapper b/bin/swaylock-wrapper new file mode 100755 index 0000000..953c6d2 --- /dev/null +++ b/bin/swaylock-wrapper @@ -0,0 +1,17 @@ +#!/bin/bash + +lock="swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 7 --effect-blur 7x5 --effect-vignette 0.5:0.5 --ring-color 451e75 --key-hl-color a01b83 --line-color 00000000 --inside-color 00000088 --separator-color 00000000" +lockt="exec ~/utils/bin/sway-locker -t" + +revert() { + killall swayidle + swayidle -w timeout 3600 "$lock" \ + timeout 3610 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep "$lockt" +} +trap revert HUP INT TERM +swayidle -w timeout 5 'swaymsg "output * dpms off"' \ +resume 'swaymsg "output * dpms on"' & +swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 7 --effect-blur 7x5 --effect-vignette 0.5:0.5 --ring-color 451e75 --key-hl-color a01b83 --line-color 00000000 --inside-color 00000088 --separator-color 00000000 +revert