shell: dock reorder, fullscreen detection fix, idle-power, sessiond, misc shell work
- Dock drag-to-reorder for pinned apps (insertion gap, quick-slide vs dwell) - Fullscreen detection: scan all windows via HyprlandData.windowList - IdleCoordinator, GlobalStates, Session.qml updates - Deploy script, qmldir, settings, wallpaper, visualizer fixes - sessiond server, memory module updates Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9ccefd6c73
commit
19fe6b1d0e
59 changed files with 19450 additions and 139 deletions
|
|
@ -74,7 +74,31 @@ id="$(echo "$response" | jq -r '.data[0].id // empty')"
|
|||
[ -n "$id" ] || id="$(date +%s)"
|
||||
dest="$WALL_DIR/wallhaven_${id}.${ext}"
|
||||
|
||||
# Re-rolled the same image we already have: skip the fetch, just report it.
|
||||
[ -f "$dest" ] || curl -fsS "$link" -o "$dest"
|
||||
# Download beside the destination, validate the complete image, then publish it
|
||||
# atomically. A failed/interrupted curl must never leave a truncated wallpaper
|
||||
# that later runs mistake for a valid cached download.
|
||||
tmp="$(mktemp --tmpdir="$WALL_DIR" ".wallhaven_${id}.XXXXXX")"
|
||||
cleanup() {
|
||||
[ -z "${tmp:-}" ] || rm -f -- "$tmp"
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
curl -fsSL --retry 2 --retry-all-errors "$link" -o "$tmp"
|
||||
mime="$(file -b --mime-type -- "$tmp" 2>/dev/null || true)"
|
||||
case "$mime" in
|
||||
image/jpeg|image/png|image/webp) ;;
|
||||
*) echo "wallhaven returned invalid image data ($mime)" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
if command -v magick >/dev/null 2>&1; then
|
||||
magick identify "$tmp" >/dev/null 2>&1 \
|
||||
|| { echo "downloaded wallpaper failed image validation" >&2; exit 1; }
|
||||
elif command -v identify >/dev/null 2>&1; then
|
||||
identify "$tmp" >/dev/null 2>&1 \
|
||||
|| { echo "downloaded wallpaper failed image validation" >&2; exit 1; }
|
||||
fi
|
||||
|
||||
mv -f -- "$tmp" "$dest"
|
||||
tmp=""
|
||||
|
||||
echo "$dest"
|
||||
|
|
|
|||
Loading…
Reference in a new issue