dots: public mirror (history reset after licence cleanup)
This commit is contained in:
commit
693822ad5f
226 files changed
+22502
No files matched your search
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
# dots-icons-link.sh — fill the dots-icons overlay theme with symlinks into the host's own
|
||||
# Tela-circle-dracula install (HyDE ships that icon theme on every GUI host).
|
||||
#
|
||||
# The overlay (gui/.local/share/icons/dots-icons/index.theme, searched before Tela) exists
|
||||
# because Tela ships its flat tray/status icons only at fixed 16/22/24px. On a fractionally
|
||||
# scaled monitor waybar asks for size×2 (44px), which falls through to Tela's coloured
|
||||
# scalable/devices circles (the blue nm-applet blob). Serving Tela's 22/panel SVGs as
|
||||
# Scalable keeps them flat at every size.
|
||||
#
|
||||
# Links, not copies: Tela-circle publishes no licence (2026-11-09), so the repo can't
|
||||
# redistribute its SVGs. Each host links its own installed files instead.
|
||||
#
|
||||
# Usage: bin/dots-icons-link.sh [-n] (-n = dry run). Idempotent; ./install.sh runs it on
|
||||
# GUI hosts. Exit 1 if Tela is missing or any icon could not be linked — the overlay then
|
||||
# degrades gracefully (Inherits=Tela-circle-dracula), so callers treat that as a warning.
|
||||
set -euo pipefail
|
||||
|
||||
DRY=0
|
||||
[ "${1:-}" = "-n" ] && DRY=1
|
||||
data="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||
src="$data/icons/Tela-circle-dracula/22/panel"
|
||||
dst="$data/icons/dots-icons/scalable/status"
|
||||
|
||||
icons=(
|
||||
blueman-active blueman-disabled blueman-tray-active blueman-tray-disabled blueman-tray
|
||||
nm-adhoc nm-device-wired-autoip nm-device-wired-secureoffline nm-device-wired-secure
|
||||
nm-device-wired nm-device-wireless nm-device-wwan nm-mb-roam nm-nm-signal-00
|
||||
nm-nm-signal-100 nm-nm-signal-25 nm-nm-signal-50 nm-nm-signal-75 nm-no-connection
|
||||
nm-secure-lock nm-signal-00-secure nm-signal-00 nm-signal-0-secure nm-signal-0
|
||||
nm-signal-100-secure nm-signal-100 nm-signal-25-secure nm-signal-25 nm-signal-50-secure
|
||||
nm-signal-50 nm-signal-75-secure nm-signal-75 nm-tech-3g nm-tech-4g nm-tech-cdma-1x
|
||||
nm-tech-edge nm-tech-evdo nm-tech-gprs nm-tech-hspa nm-tech-lte nm-tech-umts
|
||||
nm-vpn-active-lock nm-vpn-lock nm-vpn-standalone-lock nm-wwan-tower
|
||||
)
|
||||
|
||||
if [ ! -d "$src" ]; then
|
||||
echo " dots-icons: $src missing — Tela-circle-dracula not installed; overlay left empty" >&2
|
||||
exit 1
|
||||
fi
|
||||
[ "$DRY" = 1 ] || mkdir -p "$dst"
|
||||
|
||||
linked=0 ok=0 bad=0
|
||||
for n in "${icons[@]}"; do
|
||||
s="$src/$n.svg" d="$dst/$n.svg"
|
||||
if [ ! -e "$s" ]; then
|
||||
echo " dots-icons: $n.svg not in Tela-circle-dracula/22/panel (renamed upstream?)" >&2
|
||||
bad=$((bad + 1))
|
||||
elif [ -L "$d" ] && [ "$(readlink "$d")" = "$s" ]; then
|
||||
ok=$((ok + 1))
|
||||
elif [ -e "$d" ] && [ ! -L "$d" ]; then
|
||||
echo " dots-icons: $d is a real file — left alone" >&2
|
||||
bad=$((bad + 1))
|
||||
else
|
||||
[ "$DRY" = 1 ] || ln -sfn "$s" "$d"
|
||||
linked=$((linked + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
verb="linked"
|
||||
[ "$DRY" = 1 ] && verb="would link"
|
||||
echo " dots-icons: $verb $linked, $ok already linked, $bad problem(s)"
|
||||
[ "$bad" -eq 0 ]
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
# dots-themes-fetch.sh — download the third-party theme files this repo's configs use but the
|
||||
# repo doesn't ship. Each host fetches its own copy from upstream, so the repo redistributes
|
||||
# nothing and needs no licence notice. (Same idea as bin/dots-icons-link.sh, which links Tela's
|
||||
# icons from the host instead of shipping them.)
|
||||
#
|
||||
# Every entry is pinned to an upstream commit plus a sha256, so a fetch is exactly the file
|
||||
# that was reviewed. To update one: bump the commit in the URL, check the diff, then replace
|
||||
# the checksum with `curl -fsSL <url> | sha256sum`.
|
||||
#
|
||||
# Usage: bin/dots-themes-fetch.sh [-n] (-n = dry run). Idempotent; ./install.sh runs it on
|
||||
# every host. A destination that's already a real file is left alone, even if its content
|
||||
# differs (a local edit wins). A symlink there (e.g. the stow link left dangling after the
|
||||
# repo dropped the file) is replaced: mv swaps the link itself, never writes through it.
|
||||
# Exit 1 if a download or checksum failed; the app then falls back to its built-in theme, so
|
||||
# install.sh only warns.
|
||||
set -euo pipefail
|
||||
|
||||
DRY=0
|
||||
[ "${1:-}" = "-n" ] && DRY=1
|
||||
cfg="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
|
||||
# dest|sha256|url
|
||||
themes=(
|
||||
# aichat: One Half Dark by Son A. Pham (MIT), loaded as <config>/dark.tmTheme when present
|
||||
"$cfg/aichat/dark.tmTheme|6205e2311e433841f0aa1b15862b46cb892b003650f31df508a4ebc39a27bdbb|https://raw.githubusercontent.com/sonph/onehalf/d13f47b0c20923eb13335f7effc5e8ec4431a5cd/sublimetext/OneHalfDark.tmTheme"
|
||||
)
|
||||
|
||||
fetched=0 ok=0 kept=0 bad=0
|
||||
for t in "${themes[@]}"; do
|
||||
IFS='|' read -r dst sum url <<<"$t"
|
||||
name="$dst"
|
||||
case "$dst" in "$HOME"/*) name="~${dst#"$HOME"}" ;; esac
|
||||
if [ ! -d "$(dirname "$dst")" ]; then
|
||||
echo " themes: $name skipped (app not configured on this host)"
|
||||
continue
|
||||
fi
|
||||
if [ -f "$dst" ] && [ ! -L "$dst" ]; then
|
||||
if [ "$(sha256sum <"$dst" | cut -d' ' -f1)" = "$sum" ]; then
|
||||
ok=$((ok + 1))
|
||||
else
|
||||
echo " themes: $name is a real file with other content — left alone"
|
||||
kept=$((kept + 1))
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
if [ "$DRY" = 1 ]; then
|
||||
echo " themes: would fetch $name"
|
||||
fetched=$((fetched + 1))
|
||||
continue
|
||||
fi
|
||||
tmp="$(mktemp "$dst.XXXXXX")"
|
||||
if curl -fsSL --connect-timeout 5 --max-time 30 "$url" -o "$tmp" \
|
||||
&& [ "$(sha256sum <"$tmp" | cut -d' ' -f1)" = "$sum" ]; then
|
||||
chmod 644 "$tmp"
|
||||
mv -f "$tmp" "$dst"
|
||||
fetched=$((fetched + 1))
|
||||
else
|
||||
rm -f "$tmp"
|
||||
echo " themes: could not fetch $name (offline, or the checksum changed) — app uses its built-in theme" >&2
|
||||
bad=$((bad + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
verb="fetched"
|
||||
[ "$DRY" = 1 ] && verb="would fetch"
|
||||
echo " themes: $verb $fetched, $ok already present, $kept kept as local, $bad problem(s)"
|
||||
[ "$bad" -eq 0 ]
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env bash
|
||||
# dotsync — sync dotfiles with the least churn.
|
||||
#
|
||||
# Deployed configs are symlinks into this repo, so `git pull` makes edits LIVE instantly
|
||||
# with no re-stow — meaning no symlink churn and no app reloads (kitty etc. keep their
|
||||
# runtime state). Re-stowing (install.sh) is only needed when files are ADDED / REMOVED,
|
||||
# to create or prune symlinks. dotsync does the minimum: pull, and re-link ONLY if the
|
||||
# pull added/removed/renamed files.
|
||||
#
|
||||
# dotsync pull, then relink only if the file set changed
|
||||
# dotsync -n preview incoming changes (fetch only; no pull, no relink)
|
||||
# dotsync <host> as above, forcing the host package (normally unnecessary: install.sh
|
||||
# reuses the host recorded in ~/.config/dots-host)
|
||||
set -uo pipefail
|
||||
DOTS="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.." && pwd)"
|
||||
cd "$DOTS" || exit 1
|
||||
|
||||
if [ "${1:-}" = "-n" ] || [ "${1:-}" = "--dry-run" ]; then
|
||||
git fetch -q 2>/dev/null || {
|
||||
echo "fetch failed (offline?)"
|
||||
exit 1
|
||||
}
|
||||
up="$(git rev-parse --abbrev-ref '@{u}' 2>/dev/null)" || {
|
||||
echo "no upstream set"
|
||||
exit 1
|
||||
}
|
||||
# rev-list, not diff: a plain diff also fires when the LOCAL side is ahead, mislabelling
|
||||
# your own unpushed commits as incoming. Count commits that exist only on the upstream.
|
||||
n="$(git rev-list --count "HEAD..$up")"
|
||||
if [ "$n" -eq 0 ]; then echo "already up to date with $up."; else
|
||||
echo "incoming from $up ($n commit(s)):"
|
||||
git --no-pager diff --stat "HEAD...$up"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
before="$(git rev-parse HEAD)"
|
||||
if ! git pull --ff-only; then
|
||||
echo "pull not fast-forward (local commits or conflicts) — commit/stash, then retry." >&2
|
||||
exit 1
|
||||
fi
|
||||
after="$(git rev-parse HEAD)"
|
||||
|
||||
if [ "$before" = "$after" ]; then
|
||||
echo "already up to date — nothing to sync."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Services that read config ONCE at startup don't pick up pulled edits — nudge loudly.
|
||||
# (Symlinked edits are live for everything else; these are the exceptions that bit us.)
|
||||
if git diff --name-only "$before" "$after" | grep -q '\.config/llamacpp/' \
|
||||
&& systemctl cat llama.service &>/dev/null; then
|
||||
echo ""
|
||||
echo "⚠⚠ llamacpp presets changed — the router reads them only at startup. Apply with:"
|
||||
echo " sudo systemctl restart llama.service"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# A unit file is read from /etc, not through the stow symlink — needs daemon-reload as well.
|
||||
if git diff --name-only "$before" "$after" | grep -q '\.config/whisper/' \
|
||||
&& systemctl cat whisper.service &>/dev/null; then
|
||||
echo ""
|
||||
echo "⚠⚠ whisper unit changed — apply with:"
|
||||
echo " sudo systemctl daemon-reload && sudo systemctl restart whisper.service"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Modified files (M) are live only through INTACT symlinks — a live file severed by an
|
||||
# atomic rewrite (the recurring claude/settings.json class) swallows pulled edits silently,
|
||||
# so verify that premise per modified file instead of assuming it. Added/Deleted/Renamed
|
||||
# always need (un)linking. The diff is captured once, not piped into `grep -q`: its early
|
||||
# exit can SIGPIPE git under pipefail and turn the whole condition falsely negative.
|
||||
changes="$(git diff --name-status "$before" "$after")"
|
||||
need_restow=""
|
||||
if printf '%s\n' "$changes" | grep -qE '^(A|D|R)'; then
|
||||
need_restow="files added/removed/renamed"
|
||||
else
|
||||
# map each modified repo path (package/.dotpath) to its live counterpart; a real file
|
||||
# (not a symlink) sitting there means the pulled edit did NOT land
|
||||
while IFS= read -r rel; do
|
||||
live="$HOME/$rel"
|
||||
if [ -e "$live" ] && [ ! -L "$live" ]; then
|
||||
echo "note: ~/$rel is a real file, not a symlink into the repo — the pulled edit has NOT landed there."
|
||||
need_restow="severed symlink(s)"
|
||||
fi
|
||||
done < <(printf '%s\n' "$changes" | awk -F'\t' '$1 ~ /^M/ && $2 ~ /^[^\/]+\/\./ { sub(/^[^\/]+\//, "", $2); print $2 }')
|
||||
fi
|
||||
|
||||
if [ -n "$need_restow" ]; then
|
||||
echo "$need_restow — re-linking via install.sh (this may reload some apps)…"
|
||||
# Normally called with no argument, so install.sh resolves the host from ~/.config/dots-host —
|
||||
# the one recorded by the last install.sh run here. That is exactly why the host must not be
|
||||
# derived from `hostname -s`: this path is automatic and has nothing to pass. An explicit
|
||||
# `dotsync <host>` is forwarded through for the rare override.
|
||||
exec "$DOTS/install.sh" "$@"
|
||||
else
|
||||
echo "edits only — already live through the symlinks; no re-stow, no reload needed."
|
||||
fi
|
||||
Reference in new issue
Block a user