64 lines
2.7 KiB
Bash
Executable File
64 lines
2.7 KiB
Bash
Executable File
#!/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 ]
|