mirror of
https://git.adityakumar.xyz/betterlockscreen-openrc.git
synced 2024-11-14 20:29:44 +00:00
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.
This commit is contained in:
parent
ba7064dfea
commit
fc9c6b2905
1 changed files with 5 additions and 5 deletions
|
@ -42,7 +42,7 @@ lock() {
|
||||||
background=00000000
|
background=00000000
|
||||||
foreground=ffffffff
|
foreground=ffffffff
|
||||||
i3lock \
|
i3lock \
|
||||||
-t -n -i "$1" \
|
-t -i "$1" \
|
||||||
--timepos="x-90:h-ch+30" \
|
--timepos="x-90:h-ch+30" \
|
||||||
--datepos="tx+24:ty+25" \
|
--datepos="tx+24:ty+25" \
|
||||||
--clock --datestr "Type password to unlock..." \
|
--clock --datestr "Type password to unlock..." \
|
||||||
|
@ -206,28 +206,28 @@ case "$1" in
|
||||||
"")
|
"")
|
||||||
# default lockscreen
|
# default lockscreen
|
||||||
prelock
|
prelock
|
||||||
systemctl suspend && lock "$l_resized"
|
lock "$l_resized" && systemctl suspend
|
||||||
postlock
|
postlock
|
||||||
;;
|
;;
|
||||||
|
|
||||||
dim)
|
dim)
|
||||||
# lockscreen with dimmed background
|
# lockscreen with dimmed background
|
||||||
prelock
|
prelock
|
||||||
systemctl suspend && lock "$l_dim"
|
lock "$l_dim" && systemctl suspend
|
||||||
postlock
|
postlock
|
||||||
;;
|
;;
|
||||||
|
|
||||||
blur)
|
blur)
|
||||||
# set lockscreen with blurred background
|
# set lockscreen with blurred background
|
||||||
prelock
|
prelock
|
||||||
systemctl suspend && lock "$l_blur"
|
lock "$l_blur" && systemctl suspend
|
||||||
postlock
|
postlock
|
||||||
;;
|
;;
|
||||||
|
|
||||||
dimblur)
|
dimblur)
|
||||||
# set lockscreen with dimmed + blurred background
|
# set lockscreen with dimmed + blurred background
|
||||||
prelock
|
prelock
|
||||||
systemctl suspend && lock "$l_dimblur"
|
lock "$l_dimblur" && systemctl suspend
|
||||||
postlock
|
postlock
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue