diff --git a/mail/aerc-compose-neovim.sh b/old/mail/aerc-compose-neovim.sh similarity index 100% rename from mail/aerc-compose-neovim.sh rename to old/mail/aerc-compose-neovim.sh diff --git a/mail/mail-reader-daemon.hy b/old/mail/mail-reader-daemon.hy similarity index 100% rename from mail/mail-reader-daemon.hy rename to old/mail/mail-reader-daemon.hy diff --git a/mailnag-notify.py b/old/mail/mailnag-notify.py similarity index 100% rename from mailnag-notify.py rename to old/mail/mailnag-notify.py diff --git a/mail/notify-mail.hy b/old/mail/notify-mail.hy similarity index 100% rename from mail/notify-mail.hy rename to old/mail/notify-mail.hy diff --git a/battery-notify.sh b/old/x11/battery-notify.sh similarity index 100% rename from battery-notify.sh rename to old/x11/battery-notify.sh diff --git a/copy-screen-text.sh b/old/x11/copy-screen-text.sh similarity index 100% rename from copy-screen-text.sh rename to old/x11/copy-screen-text.sh diff --git a/lock-screen.sh b/old/x11/lock-screen.sh similarity index 100% rename from lock-screen.sh rename to old/x11/lock-screen.sh diff --git a/reset-saver-daemon.sh b/old/x11/reset-saver-daemon.sh similarity index 100% rename from reset-saver-daemon.sh rename to old/x11/reset-saver-daemon.sh diff --git a/screenshot.sh b/old/x11/screenshot.sh similarity index 100% rename from screenshot.sh rename to old/x11/screenshot.sh diff --git a/select-and-show-color.sh b/old/x11/select-and-show-color.sh similarity index 100% rename from select-and-show-color.sh rename to old/x11/select-and-show-color.sh diff --git a/toggle-stalonetray.sh b/old/x11/toggle-stalonetray.sh similarity index 100% rename from toggle-stalonetray.sh rename to old/x11/toggle-stalonetray.sh diff --git a/swayidle-lock-screen b/swayidle-lock-screen index 2406067..3a5bf83 100755 --- a/swayidle-lock-screen +++ b/swayidle-lock-screen @@ -5,31 +5,45 @@ function run { swayidle -w -C /dev/null \ timeout 15 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' & local swayidle_pid="${!}" - swaylock -e "${@}" + swaylock -e ${img_flags} kill "${swayidle_pid}" hyprctl dispatch dpms on dunstctl set-paused false + fix_eww +} + +function fix_eww { + for bar in ${fix_eww}; do + eww open "${bar}" + done } local background=false -let img_index=1 -for arg; do - case "${arg}" in +local fix_eww=() +while [[ "${1}" =~ '^-' ]]; do + case "${1}" in + --) + shift + break + ;; -f) background=true - ((++img_index)) + ;; + -b) + fix_eww+="${2}" + shift ;; -*) - printf "error: unknown flag '%s'\n" "${arg}" >&2 - ((++img_index)) + printf "error: unknown flag '%s'\n" "${1}" >&2 ;; esac + shift done -(( ${#} >= ${img_index} )) && img_flags=(-s fill -i "${@[${img_index}]}") +(( ${#} != 0 )) && img_flags=(-s fill -i "${1}") if ${background}; then - run ${img_flags} & + run '${img_flags}' & else - run ${img_flags} + run '${img_flags}' fi