Images in swayidle-lock-screen
This commit is contained in:
parent
fa002c5ceb
commit
48c501e9c2
@ -3,14 +3,31 @@
|
|||||||
function run {
|
function run {
|
||||||
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' &
|
||||||
local swayidle_pid="$!"
|
local swayidle_pid="${!}"
|
||||||
swaylock
|
swaylock -e "${@}"
|
||||||
kill "${swayidle_pid}"
|
kill "${swayidle_pid}"
|
||||||
hyprctl dispatch dpms on
|
hyprctl dispatch dpms on
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "${1}" == '-f' ]]; then
|
local background=false
|
||||||
run &
|
let img_index=1
|
||||||
|
for arg; do
|
||||||
|
case "${arg}" in
|
||||||
|
-f)
|
||||||
|
background=true
|
||||||
|
((++img_index))
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
printf "error: unknown flag '%s'\n" "${arg}" >&2
|
||||||
|
((++img_index))
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
(( ${#} >= ${img_index} )) && img_flags=(-s fill -i "${@[${img_index}]}")
|
||||||
|
|
||||||
|
if ${background}; then
|
||||||
|
run ${img_flags} &
|
||||||
else
|
else
|
||||||
run
|
run ${img_flags}
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user