Fix locking in swayidle-lock-screen
This commit is contained in:
parent
c41505e26c
commit
b704168e9c
@ -1,6 +1,12 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
LOCKFILE="${HOME}/.cache/swayidle-lock-screen.lock"
|
||||||
|
|
||||||
function run {
|
function run {
|
||||||
|
# ensure multiple instances do not run
|
||||||
|
mkdir -p "$(dirname "${LOCKFILE}")"
|
||||||
|
exec 4<>"${LOCKFILE}"
|
||||||
|
flock -n 4 || exit 0
|
||||||
dunstctl set-paused true
|
dunstctl set-paused true
|
||||||
swayidle -w -C /dev/null \
|
swayidle -w -C /dev/null \
|
||||||
timeout 15 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' &
|
timeout 15 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' &
|
||||||
@ -10,6 +16,7 @@ function run {
|
|||||||
hyprctl dispatch dpms on
|
hyprctl dispatch dpms on
|
||||||
dunstctl set-paused false
|
dunstctl set-paused false
|
||||||
fix_eww
|
fix_eww
|
||||||
|
flock -u 4
|
||||||
}
|
}
|
||||||
|
|
||||||
function fix_eww {
|
function fix_eww {
|
||||||
|
Loading…
Reference in New Issue
Block a user