Replaces the previous repo, which had split into two histories that never met (mainframe on a dead GitLab remote, the laptops on Gitea) with 146 dirty files across three machines and the NAS never enrolled at all. Branch-per-machine is gone. One main, with host differences expressed as small files under hosts/<hostname>/ rather than as branches, so there is nothing to merge. The reconciled zsh layer reduces 15-33 line forks to 1-7 effective lines per host; distro differences (oh-my-zsh prefix, syntax-highlighting path, fd vs fdfind) are probed in common/ instead. Fresh history: the old one carried six plaintext credentials, 45 MB of mail caches, browser caches and vendored binaries. 5,096 tracked files and 144 MB become 462 files and 2.6 MB. The .gitignore is now an allowlist, which is what keeps that true. Root cause of the rot: ~/.local/bin was a symlink to scripts/ with GOPATH inside it, so every go install wrote into version control (2.2 GB on the work laptop). PATH now points at the repo instead of the reverse. Also: Hyprland replaces sway and is sourced in two halves so $browser is defined before use; singleton automations carry ConditionHost= alongside host-layer-only placement; ddns moves from cron to a guarded timer; package manifests and pkg-snapshot/pkg-restore replace the X11-era install_scripts/; networkmanager-dmenu added to system76 (the binding always existed, the package never did).
48 lines
1.6 KiB
Bash
Executable File
48 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Re-skin Hyprland: pick a random wallpaper, crossfade to it, regenerate the
|
|
# colorscheme with wallust. Safe to run from a systemd timer.
|
|
set -euo pipefail
|
|
|
|
WALLPAPER_DIR="${WALLPAPER_DIR:-$HOME/photo/wallpapers}"
|
|
STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/hypr_refresh.last"
|
|
|
|
# If the wallpaper daemon isn't up we're almost certainly not in a graphical
|
|
# session (or hyprland hasn't started it yet). Nothing to do -- bail quietly so
|
|
# the timer doesn't spam failures.
|
|
if ! awww query >/dev/null 2>&1; then
|
|
echo "awww-daemon not running; skipping refresh" >&2
|
|
exit 0
|
|
fi
|
|
|
|
# Collect wallpapers null-delimited so paths with spaces are safe.
|
|
mapfile -d '' -t wallpapers < <(fdfind -0 -e jpg -e jpeg -e png . "$WALLPAPER_DIR")
|
|
if ((${#wallpapers[@]} == 0)); then
|
|
echo "No wallpapers found in $WALLPAPER_DIR" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Avoid showing the same wallpaper twice in a row.
|
|
last=$(cat "$STATE_FILE" 2>/dev/null || true)
|
|
if ((${#wallpapers[@]} > 1)) && [[ -n $last ]]; then
|
|
filtered=()
|
|
for w in "${wallpapers[@]}"; do
|
|
[[ $w != "$last" ]] && filtered+=("$w")
|
|
done
|
|
wallpapers=("${filtered[@]}")
|
|
fi
|
|
|
|
background=$(shuf -n1 -e "${wallpapers[@]}")
|
|
echo "Setting background to: $background"
|
|
printf '%s\n' "$background" >"$STATE_FILE"
|
|
|
|
awww img "$background" \
|
|
--transition-type random \
|
|
--transition-fps 60 \
|
|
--transition-duration 2.5
|
|
|
|
wallust -q run -s "$background"
|
|
for s in /tmp/kitty-*; do
|
|
kitten @ --to "unix:$s" set-colors --all --configured \
|
|
"${XDG_CACHE_HOME:-$HOME/.cache}/wallust/colors-kitty.conf" 2>/dev/null || true
|
|
done
|