aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Nelson <hcnelson99@gmail.com>2018-01-17 07:25:51 -0500
committerPavan Jadhaw <pavanjadhaw96@gmail.com>2018-01-17 17:55:51 +0530
commitfc9c6b2905f3afcd4971ee3f7e3d6aaa64dc9796 (patch)
tree52f05e5521d235a53d2ceee169c2d248e31ad23d
parentba7064dfea78a65392889014d96dcb610aa7c9f3 (diff)
Lock before suspend to prevent race (#28)
For suspend to work consistently, the screen must be locked before the suspend. Otherwise, occasionally the suspend will occur before the screen locks, resulting in a wakeup to a momentarily unlocked screen.
-rwxr-xr-xbetterlockscreen10
1 files changed, 5 insertions, 5 deletions
diff --git a/betterlockscreen b/betterlockscreen
index e5daa4b..895dfeb 100755
--- a/betterlockscreen
+++ b/betterlockscreen
@@ -42,7 +42,7 @@ lock() {
background=00000000
foreground=ffffffff
i3lock \
- -t -n -i "$1" \
+ -t -i "$1" \
--timepos="x-90:h-ch+30" \
--datepos="tx+24:ty+25" \
--clock --datestr "Type password to unlock..." \
@@ -206,28 +206,28 @@ case "$1" in
"")
# default lockscreen
prelock
- systemctl suspend && lock "$l_resized"
+ lock "$l_resized" && systemctl suspend
postlock
;;
dim)
# lockscreen with dimmed background
prelock
- systemctl suspend && lock "$l_dim"
+ lock "$l_dim" && systemctl suspend
postlock
;;
blur)
# set lockscreen with blurred background
prelock
- systemctl suspend && lock "$l_blur"
+ lock "$l_blur" && systemctl suspend
postlock
;;
dimblur)
# set lockscreen with dimmed + blurred background
prelock
- systemctl suspend && lock "$l_dimblur"
+ lock "$l_dimblur" && systemctl suspend
postlock
;;
esac