got working finger print usage; update nvim

This commit is contained in:
2026-09-12 14:53:16 -06:00
parent 2d5a4e9f4c
commit dabda20dae
5 changed files with 46 additions and 24 deletions
+30 -16
View File
@@ -1,8 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Print the current weather as a short icon+temp string, e.g. "🌦️ +83°F". # Print the current weather as a short icon+temp string, e.g. "🌦️ +83°F".
# Caches the wttr.in response for CACHE_MAX_AGE seconds so the lock screen and # Caches the wttr.in response so the lock screen and waybar don't hit the
# waybar don't hit the network on every refresh. Override the location with # network on every refresh. A cached value is served immediately -- even when
# WEATHER_CITY or edit CITY below. # stale -- and refreshed in the background, so a slow network never delays the
# lock screen's first frame. Override the location with WEATHER_CITY or edit
# CITY below.
set -u set -u
CITY="${WEATHER_CITY:-Denver}" CITY="${WEATHER_CITY:-Denver}"
@@ -11,24 +13,36 @@ CACHE="${CACHE_DIR}/wttr.cache"
CACHE_MAX_AGE=1800 # 30 minutes CACHE_MAX_AGE=1800 # 30 minutes
URL="https://wttr.in/${CITY}?format=%c+%t" URL="https://wttr.in/${CITY}?format=%c+%t"
cache_age() { fetch() {
[ -f "${CACHE}" ] || return 1 TMP="${CACHE}.tmp.$$"
now=$(date +%s) if curl -fsS --connect-timeout 2 --max-time 5 "${URL}" > "${TMP}" 2>/dev/null; then
mtime=$(stat -c %Y "${CACHE}") mv "${TMP}" "${CACHE}"
[ "$(( now - mtime ))" -lt "${CACHE_MAX_AGE}" ] cat "${CACHE}"
else
rm -f "${TMP}" || true
return 1
fi
} }
if cache_age; then # Fresh cache: print it.
if [ -f "${CACHE}" ] && [ "$(( $(date +%s) - $(stat -c %Y "${CACHE}") ))" -lt "${CACHE_MAX_AGE}" ]; then
cat "${CACHE}" cat "${CACHE}"
exit 0 exit 0
fi fi
TMP="${CACHE}.tmp.$$" # Stale cache: print it immediately, then refresh in the background so the
if curl -fsS --max-time 10 "${URL}" > "${TMP}" 2>/dev/null; then # caller never blocks. flock keeps a pile-up of refreshes from several clients
mv "${TMP}" "${CACHE}" # (lock screen, waybar) from running concurrent curls.
if [ -f "${CACHE}" ]; then
cat "${CACHE}" cat "${CACHE}"
else (
rm -f "${TMP}" || true exec 9>"${CACHE}.lock"
# Offline: fall back to whatever we cached last, even if stale. flock -n 9 || exit 0
[ -f "${CACHE}" ] && cat "${CACHE}" fetch >/dev/null 2>&1
) &
disown
exit 0
fi fi
# No cache at all: fetch synchronously, but with tight timeouts.
fetch
+5 -5
View File
@@ -11,13 +11,13 @@ general {
} }
# Authentication # Authentication
# Fingerprint is disabled: GDM's login worker (pam/gdm-fingerprint) holds the # Fingerprint via hyprlock's native fprintd support. PAM is password-only
# device for the whole session, so hyprlock can never claim it -- the failed # (/etc/pam.d/hyprlock) so typing a password never fights hyprlock for the
# claim blocked the auth thread and made unlocks appear stuck. Fingerprint is # fingerprint sensor. The device is not held by GDM for the user session, so
# still available at the GDM login screen; hyprlock is password-only. # the old stuck-unlock issue no longer applies.
auth { auth {
fingerprint { fingerprint {
enabled = false enabled = true
ready_message = Scan fingerprint to unlock ready_message = Scan fingerprint to unlock
present_message = Scanning... present_message = Scanning...
retry_delay = 250 # in milliseconds retry_delay = 250 # in milliseconds
+9 -1
View File
@@ -4,15 +4,23 @@
# If the real hyprlock dies, this restarts it so the session doesn't end up in a # If the real hyprlock dies, this restarts it so the session doesn't end up in a
# "lockscreen app died" state. Requires misc:allow_session_lock_restore = true # "lockscreen app died" state. Requires misc:allow_session_lock_restore = true
# in Hyprland config for the replacement lock to be accepted. # in Hyprland config for the replacement lock to be accepted.
#
# --immediate-render: present the first frame as soon as the background is up
# instead of waiting for every resource (labels run scripts like weather.sh).
# Assets pop in when ready, so the "lock screen took seconds to appear" stalls
# (Hyprland "Lockdead frames") don't happen.
set -u set -u
REAL_HYPRLOCK=/usr/bin/hyprlock REAL_HYPRLOCK=/usr/bin/hyprlock
MAX_RESTARTS=20 MAX_RESTARTS=20
# hyprlock logs to stdout/stderr; capture them so the last lock cycle is
# readable for debugging (fprint claim/verify, auth results).
LOGFILE="${XDG_RUNTIME_DIR:-/tmp}/hyprlock.log"
restart=0 restart=0
while true; do while true; do
"$REAL_HYPRLOCK" "$@" "$REAL_HYPRLOCK" --immediate-render "$@" >"${LOGFILE}" 2>&1
code=$? code=$?
# 0: exited cleanly (e.g. unlocked) -- done. # 0: exited cleanly (e.g. unlocked) -- done.
+1 -1
View File
@@ -56,5 +56,5 @@
} }
], ],
"workspace_rules": [], "workspace_rules": [],
"last_applied_time": 1788832965.6726744 "last_applied_time": 1789241254.0499482
} }