@sebastienrousseau/dotfiles 0.2.502 → 0.2.503
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -9
- package/LICENSE +21 -1283
- package/README.md +5 -3
- package/docs/CONFIG_STRATEGY.md +124 -0
- package/docs/COPYRIGHT +1 -1
- package/docs/GOVERNANCE.md +98 -0
- package/docs/MAINTAINERS.md +41 -0
- package/docs/OPENCODE.md +127 -0
- package/docs/README.md +2 -0
- package/docs/STRUCTURE.md +102 -0
- package/docs/adr/ADR-011-nushell-tier3-keep.md +2 -2
- package/docs/architecture/AI_COST_OPTIMIZATION.md +143 -0
- package/docs/architecture/REPO_LAYOUT.md +8 -8
- package/docs/archive/MILESTONE_v0.2.493.md +1 -1
- package/docs/index.md +2 -2
- package/docs/interop/POWERSHELL.md +1 -1
- package/docs/manual/00-introduction.md +1 -1
- package/docs/manual/01-concepts/02-trust-model.md +1 -1
- package/docs/manual/03-reference/02-config-files.md +2 -2
- package/docs/manual/_toc.yml +1 -1
- package/docs/manual/command-index.md +72 -59
- package/docs/operations/CI_COMPOSITES.md +2 -2
- package/docs/operations/COMPLETIONS.md +2 -2
- package/docs/operations/COVERAGE.md +5 -5
- package/docs/operations/HARD_AUDIT_2026.md +11 -11
- package/docs/operations/MAINTENANCE.md +3 -3
- package/docs/operations/MANIFEST.md +127 -0
- package/docs/operations/RELEASE_PIPELINE.md +130 -0
- package/docs/operations/RFC_v0_2_503_reorganization.md +280 -0
- package/docs/operations/ROADMAP_2026.md +6 -6
- package/docs/operations/ROADMAP_V0_2_503.md +134 -0
- package/docs/operations/TESTING.md +17 -0
- package/docs/operations/TRACEABILITY.md +6 -3
- package/docs/operations/VERSION_SYNC.md +4 -4
- package/docs/reference/POWERSHELL_PARITY.md +8 -7
- package/docs/schema/dot-env-v1.json +110 -0
- package/docs/security/CI_EGRESS_ALLOWLIST.md +1 -1
- package/docs/security/CI_PINNING.md +17 -9
- package/docs/security/DEPS_DEV_EXCEPTIONS.md +2 -2
- package/docs/security/FUZZING.md +114 -0
- package/docs/security/INSTALL_VERIFICATION.md +2 -2
- package/docs/security/POLICY_RELEASES.md +2 -2
- package/docs/security/SCORECARD.md +58 -3
- package/docs/security/SHELL_EXEMPTIONS.md +4 -4
- package/docs/security/VERIFY_RELEASE.md +201 -0
- package/install.sh +27 -5
- package/package.json +1 -1
- package/scripts/README.md +123 -0
- package/scripts/ci/check-copyright-headers.sh +4 -93
- package/scripts/ci/check-shell-preamble.sh +4 -103
- package/scripts/ci/guard-gitleaks-checkout.sh +4 -54
- package/scripts/diagnostics/a2a-conformance.sh +4 -4
- package/scripts/diagnostics/alias-governance.sh +1 -1
- package/scripts/diagnostics/aliases-cheatsheet.sh +2 -2
- package/scripts/diagnostics/benchmark.sh +4 -4
- package/scripts/diagnostics/conflicts.sh +2 -2
- package/scripts/diagnostics/doctor-unified.sh +2 -2
- package/scripts/diagnostics/doctor.sh +10 -10
- package/scripts/diagnostics/drift-dashboard.sh +2 -2
- package/scripts/diagnostics/health.sh +4 -4
- package/scripts/diagnostics/history-analysis.sh +2 -2
- package/scripts/diagnostics/mcp-doctor.sh +10 -7
- package/scripts/diagnostics/perf.sh +4 -4
- package/scripts/diagnostics/scorecard.sh +4 -4
- package/scripts/diagnostics/security-score.sh +2 -2
- package/scripts/diagnostics/smoke-test.sh +2 -2
- package/scripts/diagnostics/snapshot.sh +2 -2
- package/scripts/diagnostics/verify.sh +4 -4
- package/scripts/diagnostics/version-locks.sh +2 -2
- package/scripts/diagnostics/workstation-attestation.sh +14 -14
- package/scripts/dot/commands/agent.sh +8 -0
- package/scripts/dot/commands/agents.sh +14 -4
- package/scripts/dot/commands/ai.sh +144 -25
- package/scripts/dot/commands/appearance.sh +2 -2
- package/scripts/dot/commands/core.sh +2 -2
- package/scripts/dot/commands/diagnostics.sh +5 -5
- package/scripts/dot/commands/env-emit.sh +202 -0
- package/scripts/dot/commands/fleet.sh +12 -11
- package/scripts/dot/commands/init.sh +4 -4
- package/scripts/dot/commands/lint.sh +9 -4
- package/scripts/dot/commands/manual.sh +3 -3
- package/scripts/dot/commands/meta.sh +12 -6
- package/scripts/dot/commands/patterns.sh +2 -2
- package/scripts/dot/commands/registry.sh +4 -4
- package/scripts/dot/commands/restore.sh +4 -4
- package/scripts/dot/commands/secrets.sh +4 -3
- package/scripts/dot/commands/security.sh +2 -2
- package/scripts/dot/commands/tools.sh +13 -3
- package/scripts/dot/powershell/Dot.psm1 +199 -0
- package/scripts/fonts/install-nerd-fonts.sh +2 -2
- package/scripts/git-hooks/pre-commit-audit.sh +2 -2
- package/scripts/git-hooks/pre-push +13 -0
- package/scripts/ops/ai-setup.sh +1 -1
- package/scripts/ops/bundle.sh +2 -2
- package/scripts/ops/chaos.sh +2 -2
- package/scripts/ops/chezmoi-apply.sh +4 -4
- package/scripts/ops/heal.sh +4 -4
- package/scripts/ops/post-apply-repair.sh +2 -2
- package/scripts/ops/prewarm.sh +2 -2
- package/scripts/ops/release.sh +4 -4
- package/scripts/ops/rollback.sh +4 -4
- package/scripts/ops/setup.sh +2 -2
- package/scripts/qa/check-version-consistency.sh +123 -0
- package/scripts/qa/coverage-baseline.sh +1 -1
- package/scripts/qa/docs-coverage.sh +2 -2
- package/scripts/qa/powershell-contract.ps1 +1 -1
- package/scripts/qa/scorecard-snapshot.sh +127 -0
- package/scripts/security/backup.sh +2 -2
- package/scripts/security/dns-doh.sh +4 -4
- package/scripts/security/encryption-check.sh +4 -4
- package/scripts/security/enforce-policies.sh +2 -2
- package/scripts/security/firewall.sh +4 -4
- package/scripts/security/lock-screen.sh +4 -4
- package/scripts/security/manage-secrets.sh +2 -2
- package/scripts/security/ssh-cert.sh +2 -2
- package/scripts/security/telemetry-kill.sh +4 -4
- package/scripts/security/usb-safety.sh +4 -4
- package/scripts/theme/extract-heic-frames.sh +114 -0
- package/scripts/theme/rebuild-themes.sh +8 -1
- package/scripts/theme/switch.sh +13 -6
- package/scripts/theme/wallpaper-sync.sh +297 -93
- package/scripts/tuning/linux.sh +2 -2
- package/scripts/tuning/macos.sh +2 -2
- package/scripts/version-sync.sh +55 -7
- package/dot_config/.module-manifest.json +0 -69
- package/dot_config/ai/identity.md +0 -23
- package/dot_config/ai/patterns/architect.md +0 -16
- package/dot_config/ai/patterns/hardener.md +0 -15
- package/dot_config/ai/patterns/refactor.md +0 -15
- package/dot_config/aider/aider.conf.yml +0 -32
- package/dot_config/alacritty/alacritty.toml.tmpl +0 -55
- package/dot_config/ansible/ansible.cfg +0 -11
- package/dot_config/atuin/config.toml.tmpl +0 -47
- package/dot_config/bat/config +0 -23
- package/dot_config/brave-flags.conf.tmpl +0 -7
- package/dot_config/btop/btop.conf +0 -16
- package/dot_config/btop/themes/tokyonight.theme +0 -34
- package/dot_config/bun/bunfig.toml.tmpl +0 -33
- package/dot_config/claude/mcp_servers.json +0 -20
- package/dot_config/containers/containers.conf +0 -14
- package/dot_config/curl/dot_curlrc +0 -18
- package/dot_config/dlv/config.yml +0 -39
- package/dot_config/docker/config.json +0 -15
- package/dot_config/dotfiles/agent-card.json +0 -29
- package/dot_config/dotfiles/agent-profiles.json +0 -92
- package/dot_config/dotfiles/boot/README.md +0 -13
- package/dot_config/dotfiles/grub/README.md +0 -13
- package/dot_config/dotfiles/lock/README.md +0 -13
- package/dot_config/dotfiles/mcp-lock.json +0 -33
- package/dot_config/dotfiles/mcp-policy.json +0 -52
- package/dot_config/dotfiles/mcp-registry.json +0 -47
- package/dot_config/dotfiles/model-registry.json +0 -20
- package/dot_config/dotfiles/policy-bundles.json +0 -38
- package/dot_config/dotfiles/prompt-registry.json +0 -16
- package/dot_config/dotfiles/versions.env +0 -18
- package/dot_config/duf/duf.conf +0 -6
- package/dot_config/duti/defaults.duti +0 -5
- package/dot_config/emoji/emoji.txt +0 -34
- package/dot_config/environment.d/50-ssh-agent.conf +0 -2
- package/dot_config/environment.d/90-wayland.conf +0 -19
- package/dot_config/fastfetch/config.jsonc +0 -28
- package/dot_config/firefox/user.js.tmpl +0 -58
- package/dot_config/fish/completions/dot-theme-sync.fish.tmpl +0 -9
- package/dot_config/fish/completions/dot.fish.tmpl +0 -115
- package/dot_config/fish/conf.d/000-perf-cache.fish +0 -56
- package/dot_config/fish/conf.d/aliases.fish.tmpl +0 -77
- package/dot_config/fish/conf.d/direnv.fish +0 -4
- package/dot_config/fish/conf.d/env.fish.tmpl +0 -48
- package/dot_config/fish/conf.d/functions.fish.tmpl +0 -22
- package/dot_config/fish/conf.d/init.fish.tmpl +0 -172
- package/dot_config/fish/conf.d/mise-activate.fish +0 -5
- package/dot_config/fish/config.fish.tmpl +0 -44
- package/dot_config/fish/fish_plugins +0 -1
- package/dot_config/fish/functions/_.fish +0 -3
- package/dot_config/fish/functions/_cached_eval.fish +0 -131
- package/dot_config/fish/functions/_cached_eval_clear.fish +0 -17
- package/dot_config/fish/functions/als.fish +0 -46
- package/dot_config/fish/functions/bg-upgrade.fish +0 -7
- package/dot_config/fish/functions/c.fish +0 -3
- package/dot_config/fish/functions/cat.fish +0 -9
- package/dot_config/fish/functions/d.fish +0 -7
- package/dot_config/fish/functions/dot.fish +0 -34
- package/dot_config/fish/functions/h.fish +0 -3
- package/dot_config/fish/functions/l.fish +0 -7
- package/dot_config/fish/functions/la.fish +0 -7
- package/dot_config/fish/functions/ll.fish +0 -7
- package/dot_config/fish/functions/log_error.fish +0 -13
- package/dot_config/fish/functions/log_info.fish +0 -13
- package/dot_config/fish/functions/lr.fish +0 -7
- package/dot_config/fish/functions/lra.fish +0 -7
- package/dot_config/fish/functions/ls.fish +0 -7
- package/dot_config/fish/functions/lt.fish +0 -7
- package/dot_config/fish/functions/lta.fish +0 -7
- package/dot_config/fish/functions/notify-run.fish +0 -11
- package/dot_config/fish/functions/q.fish +0 -3
- package/dot_config/fish/functions/silent-run.fish +0 -7
- package/dot_config/fish/functions/yy.fish +0 -8
- package/dot_config/flatpak/flatpak.list +0 -4
- package/dot_config/fontconfig/fonts.conf.tmpl +0 -57
- package/dot_config/foot/foot.ini.tmpl +0 -33
- package/dot_config/fuzzel/fuzzel.ini.tmpl +0 -18
- package/dot_config/fzf/fzf.zsh +0 -48
- package/dot_config/gem/gemrc +0 -9
- package/dot_config/gh/config.yml +0 -12
- package/dot_config/ghostty/config.tmpl +0 -165
- package/dot_config/git/allowed_signers.tmpl +0 -18
- package/dot_config/git/attributes +0 -12
- package/dot_config/git/commit-template +0 -10
- package/dot_config/git/hooks/executable_commit-msg +0 -146
- package/dot_config/git/ignore +0 -27
- package/dot_config/gnupg/gpg-agent.conf +0 -11
- package/dot_config/go/golangci.yml +0 -118
- package/dot_config/go/gopls.json +0 -30
- package/dot_config/goose/config.yaml +0 -29
- package/dot_config/gtk-3.0/gtk.css.tmpl +0 -184
- package/dot_config/gtk-3.0/settings.ini.tmpl +0 -27
- package/dot_config/gtk-4.0/gtk.css.tmpl +0 -252
- package/dot_config/gtk-4.0/settings.ini.tmpl +0 -18
- package/dot_config/htop/htoprc +0 -20
- package/dot_config/inputrc +0 -2
- package/dot_config/ipython/profile_default/ipython_config.py +0 -19
- package/dot_config/just/justfile +0 -122
- package/dot_config/k9s/config.yaml +0 -65
- package/dot_config/k9s/skins/catppuccin-mocha.yaml +0 -116
- package/dot_config/kanshi/config.tmpl +0 -22
- package/dot_config/karabiner/karabiner.json +0 -14
- package/dot_config/kitty/kitty.conf.tmpl +0 -53
- package/dot_config/lazydocker/config.yml +0 -186
- package/dot_config/lazygit/config.yml +0 -35
- package/dot_config/mako/config +0 -47
- package/dot_config/mas/masapps.txt +0 -5
- package/dot_config/micro/settings.json +0 -3
- package/dot_config/mimeapps.list +0 -77
- package/dot_config/minikube/config.json +0 -13
- package/dot_config/mise/config.toml +0 -99
- package/dot_config/mongosh/mongoshrc.js +0 -68
- package/dot_config/mpv/input.conf +0 -47
- package/dot_config/mpv/mpv.conf +0 -47
- package/dot_config/mycli/myclirc +0 -67
- package/dot_config/nano/nanorc +0 -28
- package/dot_config/ncdu/config +0 -12
- package/dot_config/niri/config.kdl.tmpl +0 -327
- package/dot_config/nushell/aliases.nu +0 -18
- package/dot_config/nushell/cached_eval.nu +0 -80
- package/dot_config/nushell/completions.nu.tmpl +0 -52
- package/dot_config/nushell/config.nu.tmpl +0 -86
- package/dot_config/nushell/env.nu.tmpl +0 -102
- package/dot_config/nushell/functions.nu.tmpl +0 -17
- package/dot_config/nvim/init.lua +0 -18
- package/dot_config/nvim/lazy-lock.json +0 -58
- package/dot_config/nvim/lua/config/autocmds.lua +0 -107
- package/dot_config/nvim/lua/config/keymaps.lua +0 -92
- package/dot_config/nvim/lua/config/lazy.lua +0 -44
- package/dot_config/nvim/lua/config/options.lua +0 -49
- package/dot_config/nvim/lua/plugins/ai.lua +0 -75
- package/dot_config/nvim/lua/plugins/coding.lua +0 -216
- package/dot_config/nvim/lua/plugins/completion.lua +0 -60
- package/dot_config/nvim/lua/plugins/dap.lua +0 -412
- package/dot_config/nvim/lua/plugins/editor.lua +0 -55
- package/dot_config/nvim/lua/plugins/git.lua +0 -10
- package/dot_config/nvim/lua/plugins/lsp.lua +0 -156
- package/dot_config/nvim/lua/plugins/markdown.lua +0 -18
- package/dot_config/nvim/lua/plugins/rust.lua +0 -34
- package/dot_config/nvim/lua/plugins/sessions.lua +0 -33
- package/dot_config/nvim/lua/plugins/ui.lua +0 -509
- package/dot_config/paru/paru.conf +0 -10
- package/dot_config/pip/pip.conf.tmpl +0 -32
- package/dot_config/powershell/Microsoft.PowerShell_profile.ps1.tmpl +0 -81
- package/dot_config/pueue/pueue.yml +0 -34
- package/dot_config/pypoetry/config.toml +0 -6
- package/dot_config/pyrightconfig.json +0 -5
- package/dot_config/raycast/README.md +0 -13
- package/dot_config/redis/redisclirc +0 -41
- package/dot_config/ripgrep/ripgreprc +0 -21
- package/dot_config/shell/00-core-paths.sh.tmpl +0 -141
- package/dot_config/shell/05-core-safety.sh +0 -48
- package/dot_config/shell/10-secrets.sh +0 -41
- package/dot_config/shell/40-fzf-defaults.sh.tmpl +0 -17
- package/dot_config/shell/40-ls-colors.sh +0 -49
- package/dot_config/shell/50-logic-functions-core.sh.tmpl +0 -11
- package/dot_config/shell/50-logic-functions.sh.tmpl +0 -11
- package/dot_config/shell/51-logic-functions-extra.sh.tmpl +0 -65
- package/dot_config/shell/90-ux-aliases.sh.tmpl +0 -121
- package/dot_config/shell/91-ux-aliases-lazy.sh.tmpl +0 -55
- package/dot_config/shell/Brewfile +0 -207
- package/dot_config/shell/Brewfile.cask +0 -92
- package/dot_config/shell/Brewfile.cli +0 -127
- package/dot_config/shell/README.md +0 -284
- package/dot_config/shell/als_data.txt.tmpl +0 -65
- package/dot_config/shell/custom/auto_ls.zsh +0 -20
- package/dot_config/shell/custom/context_suggest.zsh +0 -68
- package/dot_config/shell/custom/error_analysis.zsh +0 -45
- package/dot_config/sops/dot_sops.yaml +0 -23
- package/dot_config/starship.toml.tmpl +0 -202
- package/dot_config/swaylock/config +0 -43
- package/dot_config/systemd/user/dotfiles-maintenance.service +0 -8
- package/dot_config/systemd/user/dotfiles-maintenance.timer +0 -11
- package/dot_config/systemd/user/pueued.service +0 -12
- package/dot_config/systemd/user/ssh-agent.service +0 -12
- package/dot_config/task/Taskfile.yml +0 -86
- package/dot_config/tflint/tflint.hcl +0 -9
- package/dot_config/tmux/tmux.conf.tmpl +0 -223
- package/dot_config/topgrade.toml.tmpl +0 -54
- package/dot_config/user-dirs.dirs +0 -10
- package/dot_config/vscode/extensions.txt +0 -11
- package/dot_config/vscode/settings.json.tmpl +0 -82
- package/dot_config/waybar/config.jsonc.tmpl +0 -90
- package/dot_config/waybar/style.css.tmpl +0 -211
- package/dot_config/wezterm/wezterm.lua.tmpl +0 -64
- package/dot_config/wget/wgetrc +0 -12
- package/dot_config/xdg-desktop-portal/niri-portals.conf +0 -5
- package/dot_config/yarn/yarnrc.yml +0 -36
- package/dot_config/yazi/keymap.toml +0 -67
- package/dot_config/yazi/theme.toml +0 -102
- package/dot_config/yazi/yazi.toml +0 -40
- package/dot_config/zathura/zathurarc +0 -52
- package/dot_config/zellij/config.kdl.tmpl +0 -79
- package/dot_config/zsh/dot_zprofile +0 -7
- package/dot_config/zsh/dot_zshenv +0 -5
- package/dot_config/zsh/dot_zshrc.tmpl +0 -688
- package/dot_config/zsh/rc.d/00-alias-shims.zsh +0 -99
- package/dot_config/zsh/rc.d/05-ssh-agent.zsh +0 -18
- package/dot_config/zsh/rc.d/10-env.zsh.tmpl +0 -28
- package/dot_config/zsh/rc.d/20-zinit.zsh +0 -65
- package/dot_config/zsh/rc.d/30-options.zsh.tmpl +0 -214
- package/dot_config/zsh/rc.d/40-bell.zsh +0 -20
- package/dot_config/zsh/rc.d/50-login-fortune.zsh +0 -9
- package/dot_config/zsh/rc.d/99-alias-wrapper.zsh +0 -32
- package/dot_local/bin/executable_ai-update +0 -195
- package/dot_local/bin/executable_ai_core +0 -152
- package/dot_local/bin/executable_antigravity +0 -11
- package/dot_local/bin/executable_b64 +0 -84
- package/dot_local/bin/executable_bm +0 -79
- package/dot_local/bin/executable_cb +0 -39
- package/dot_local/bin/executable_dot +0 -636
- package/dot_local/bin/executable_dot-ai +0 -36
- package/dot_local/bin/executable_dot-bootstrap +0 -76
- package/dot_local/bin/executable_dot-launch-or-focus +0 -52
- package/dot_local/bin/executable_dot-load-benchmark +0 -31
- package/dot_local/bin/executable_dot-load-benchmark-pty +0 -77
- package/dot_local/bin/executable_dot-theme-sync +0 -952
- package/dot_local/bin/executable_dot_completion +0 -57
- package/dot_local/bin/executable_dtags +0 -28
- package/dot_local/bin/executable_epoch +0 -67
- package/dot_local/bin/executable_extract +0 -41
- package/dot_local/bin/executable_gbd +0 -52
- package/dot_local/bin/executable_gd +0 -42
- package/dot_local/bin/executable_git-ai-commit +0 -175
- package/dot_local/bin/executable_git-ai-diff +0 -169
- package/dot_local/bin/executable_gl +0 -101
- package/dot_local/bin/executable_hash +0 -161
- package/dot_local/bin/executable_hashsum +0 -160
- package/dot_local/bin/executable_hex +0 -115
- package/dot_local/bin/executable_jsonv +0 -78
- package/dot_local/bin/executable_jwt +0 -94
- package/dot_local/bin/executable_kill-port +0 -75
- package/dot_local/bin/executable_lorem +0 -118
- package/dot_local/bin/executable_mkscript +0 -35
- package/dot_local/bin/executable_monitor +0 -56
- package/dot_local/bin/executable_myip +0 -51
- package/dot_local/bin/executable_notify +0 -24
- package/dot_local/bin/executable_open +0 -38
- package/dot_local/bin/executable_pw +0 -27
- package/dot_local/bin/executable_rec-start +0 -46
- package/dot_local/bin/executable_rec-stop +0 -35
- package/dot_local/bin/executable_regex +0 -132
- package/dot_local/bin/executable_start-niri +0 -8
- package/dot_local/bin/executable_tmux-sessionizer +0 -314
- package/dot_local/bin/executable_tour +0 -177
- package/dot_local/bin/executable_up +0 -23
- package/dot_local/bin/executable_update +0 -142
- package/dot_local/bin/executable_uuid +0 -87
- package/dot_local/bin/executable_win +0 -32
- package/dot_local/bin/executable_yamlv +0 -57
- package/dot_local/share/bash-completion/completions/dot +0 -72
- package/dot_local/share/icons/hicolor/128x128/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/16x16/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/24x24/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/256x256/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/32x32/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/48x48/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/512x512/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/64x64/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/96x96/apps/rousseau.png +0 -0
- package/dot_local/share/icons/hicolor/scalable/apps/rousseau.png +0 -0
- package/dot_local/share/man/man1/dot.1 +0 -149
- package/dot_local/share/mise/plugins/kiro-cli/bin/executable_download +0 -64
- package/dot_local/share/mise/plugins/kiro-cli/bin/executable_install +0 -18
- package/dot_local/share/mise/plugins/kiro-cli/bin/executable_list-all +0 -13
- package/dot_local/share/wayland-sessions/niri.desktop.tmpl +0 -6
- package/dot_local/share/zsh/completions/.keep +0 -0
- package/dot_local/share/zsh/completions/_dot +0 -287
- package/scripts/ci/check-dangerous-chmod.sh +0 -19
- package/scripts/ci/check-deps-dev.sh +0 -236
- package/scripts/ci/check-insecure-tls.sh +0 -61
- package/scripts/ci/check-regression-traceability.sh +0 -67
- package/scripts/ci/dot-cli-startup-bench.sh +0 -126
- package/scripts/ci/install-chezmoi-verified.sh +0 -67
- package/scripts/ci/lint-reusable-pins.sh +0 -78
- package/scripts/ci/run-coverage.sh +0 -451
- package/scripts/ci/validate-chezmoidata.sh +0 -25
- package/scripts/ci/validate-ci-config.sh +0 -224
- package/scripts/ci/windows-smoke-test.ps1 +0 -136
- package/scripts/docs/build-manual.sh +0 -883
- package/scripts/docs/check-manual.sh +0 -213
- package/scripts/dot/lib/bento.sh +0 -50
- package/scripts/dot/lib/log.sh +0 -200
- package/scripts/dot/lib/platform.sh +0 -112
- package/scripts/dot/lib/ui.sh +0 -650
- package/scripts/dot/lib/utils.sh +0 -377
- package/scripts/maintenance/check-updates.sh +0 -131
- package/scripts/release/package-policy-bundles.sh +0 -125
package/scripts/dot/lib/ui.sh
DELETED
|
@@ -1,650 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Copyright (c) 2015-2026 Dotfiles. All rights reserved.
|
|
3
|
-
# Sourced by scripts/dot/commands/*.sh, scripts/diagnostics/*, scripts/ops/*; inherits set -euo pipefail.
|
|
4
|
-
## Dotfiles CLI UI Component Library — Single Source of Truth.
|
|
5
|
-
##
|
|
6
|
-
## All CLI output MUST go through these primitives. No raw printf with
|
|
7
|
-
## hardcoded ANSI is allowed in scripts; source this file and call the
|
|
8
|
-
## functions below instead.
|
|
9
|
-
##
|
|
10
|
-
## # Primitives
|
|
11
|
-
## Status: ui_ok, ui_err, ui_warn, ui_info, ui_meta
|
|
12
|
-
## Layout: ui_header, ui_section, ui_cmd, ui_kv, ui_bullet, ui_logo_dot
|
|
13
|
-
## Animated: ui_spinner_start, ui_spinner_stop, ui_progress, ui_run_cmd
|
|
14
|
-
## Interact: ui_confirm, ui_toast
|
|
15
|
-
## Cursor: ui_clear_line, ui_hide_cursor, ui_show_cursor
|
|
16
|
-
##
|
|
17
|
-
## # Platform Notes
|
|
18
|
-
## - macOS: Full support via Homebrew gum
|
|
19
|
-
## - Linux: Full support (tput, UTF-8)
|
|
20
|
-
## - WSL: Works with Windows Terminal color passthrough
|
|
21
|
-
## - CI/TTY: Graceful fallback when stdout is not a terminal
|
|
22
|
-
##
|
|
23
|
-
## # Standards
|
|
24
|
-
## - Respects NO_COLOR (https://no-color.org)
|
|
25
|
-
## - Respects DOTFILES_ACCESSIBILITY=1 (ASCII-only, no gum)
|
|
26
|
-
## - Guarded against multiple source/init (idempotent)
|
|
27
|
-
##
|
|
28
|
-
## # Usage
|
|
29
|
-
## source "$SCRIPT_DIR/lib/ui.sh"
|
|
30
|
-
## ui_init
|
|
31
|
-
## ui_header "Section Title"
|
|
32
|
-
## ui_ok "Operation succeeded"
|
|
33
|
-
|
|
34
|
-
# Re-source guard: re-sourcing would zero out the BOLD/RED/etc colour
|
|
35
|
-
# variables that ui_init() populated, breaking already-rendered output.
|
|
36
|
-
[[ "${_DOT_LIB_UI_LOADED:-0}" == "1" ]] && return 0
|
|
37
|
-
_DOT_LIB_UI_LOADED=1
|
|
38
|
-
|
|
39
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
40
|
-
# State — all zeroed before ui_init
|
|
41
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
42
|
-
UI_ENABLED=0 # gum available + interactive
|
|
43
|
-
UI_INITED=0 # guard flag
|
|
44
|
-
UI_COLOR=0 # tput colors available
|
|
45
|
-
UI_UTF8=0 # terminal supports UTF-8
|
|
46
|
-
|
|
47
|
-
BOLD=""
|
|
48
|
-
NORMAL=""
|
|
49
|
-
RED=""
|
|
50
|
-
GREEN=""
|
|
51
|
-
YELLOW=""
|
|
52
|
-
BLUE=""
|
|
53
|
-
MAGENTA=""
|
|
54
|
-
CYAN=""
|
|
55
|
-
GRAY=""
|
|
56
|
-
|
|
57
|
-
# Glyph set — overridden to ASCII by DOTFILES_ACCESSIBILITY
|
|
58
|
-
_GL_OK="✓"
|
|
59
|
-
_GL_FAIL="✗"
|
|
60
|
-
_GL_WARN="⚠"
|
|
61
|
-
_GL_INFO="•"
|
|
62
|
-
_GL_BULLET="•"
|
|
63
|
-
_GL_LOGO="◈"
|
|
64
|
-
_GL_SPINNER=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏')
|
|
65
|
-
_GL_BAR_FILL="■"
|
|
66
|
-
_GL_BAR_EMPTY="・"
|
|
67
|
-
|
|
68
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
69
|
-
# Initialisation (called once, guard-protected)
|
|
70
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
71
|
-
ui_init() {
|
|
72
|
-
[[ "$UI_INITED" = "1" ]] && return
|
|
73
|
-
|
|
74
|
-
# --- Accessibility: disable gum + UTF-8 glyphs ---
|
|
75
|
-
if [[ "${DOTFILES_ACCESSIBILITY:-0}" == "1" ]]; then
|
|
76
|
-
UI_ENABLED=0
|
|
77
|
-
UI_UTF8=0
|
|
78
|
-
_GL_OK="[OK]"
|
|
79
|
-
_GL_FAIL="[FAIL]"
|
|
80
|
-
_GL_WARN="[WARN]"
|
|
81
|
-
_GL_INFO="[INFO]"
|
|
82
|
-
_GL_BULLET="*"
|
|
83
|
-
_GL_LOGO="@"
|
|
84
|
-
_GL_SPINNER=('-' '\\' '|' '/')
|
|
85
|
-
_GL_BAR_FILL="#"
|
|
86
|
-
_GL_BAR_EMPTY="-"
|
|
87
|
-
else
|
|
88
|
-
# gum detection (interactive TTY only)
|
|
89
|
-
if command -v gum >/dev/null 2>&1 && [[ -t 1 ]]; then
|
|
90
|
-
UI_ENABLED=1
|
|
91
|
-
fi
|
|
92
|
-
# UTF-8 detection
|
|
93
|
-
if [[ "$(locale charmap 2>/dev/null || true)" = "UTF-8" ]]; then
|
|
94
|
-
UI_UTF8=1
|
|
95
|
-
fi
|
|
96
|
-
fi
|
|
97
|
-
|
|
98
|
-
# --- Color palette (tput) ---
|
|
99
|
-
if [[ -t 1 ]] && [[ -z "${NO_COLOR:-}" ]] && command -v tput >/dev/null 2>&1 && tput setaf 1 >/dev/null 2>&1; then
|
|
100
|
-
UI_COLOR=1
|
|
101
|
-
BOLD="$(tput bold)"
|
|
102
|
-
NORMAL="$(tput sgr0)"
|
|
103
|
-
RED="$(tput setaf 1)"
|
|
104
|
-
GREEN="$(tput setaf 2)"
|
|
105
|
-
YELLOW="$(tput setaf 3)"
|
|
106
|
-
BLUE="$(tput setaf 4)"
|
|
107
|
-
MAGENTA="$(tput setaf 5)"
|
|
108
|
-
CYAN="$(tput setaf 6)"
|
|
109
|
-
GRAY="$(tput setaf 8)"
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
UI_INITED=1
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
116
|
-
# Layout primitives
|
|
117
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
118
|
-
|
|
119
|
-
ui_header() {
|
|
120
|
-
local text="$1"
|
|
121
|
-
ui_init
|
|
122
|
-
if [[ "$UI_ENABLED" = "1" ]]; then
|
|
123
|
-
gum style --foreground 212 --bold "$text"
|
|
124
|
-
elif [[ "$UI_COLOR" = "1" ]]; then
|
|
125
|
-
printf "%s%s%s\n" "${BOLD}${BLUE}" "$text" "$NORMAL"
|
|
126
|
-
else
|
|
127
|
-
echo "--- $text ---"
|
|
128
|
-
fi
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
ui_section() {
|
|
132
|
-
local text="$1"
|
|
133
|
-
ui_init
|
|
134
|
-
if [[ "$UI_ENABLED" = "1" ]]; then
|
|
135
|
-
gum style --foreground 212 --bold "$text"
|
|
136
|
-
elif [[ "$UI_COLOR" = "1" ]]; then
|
|
137
|
-
printf "%s%s%s\n" "${BOLD}${CYAN}" "$text" "$NORMAL"
|
|
138
|
-
else
|
|
139
|
-
echo "== $text =="
|
|
140
|
-
fi
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
144
|
-
# Status primitives (✓ ✗ ⚠ •)
|
|
145
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
146
|
-
|
|
147
|
-
ui_status() {
|
|
148
|
-
local symbol="$1"
|
|
149
|
-
local alt_symbol="$2"
|
|
150
|
-
local label="$3"
|
|
151
|
-
local detail="${4:-}"
|
|
152
|
-
local color="${5:-}"
|
|
153
|
-
local width="${6:-35}"
|
|
154
|
-
ui_init
|
|
155
|
-
|
|
156
|
-
local disp_symbol="$symbol"
|
|
157
|
-
if [[ "${DOTFILES_ACCESSIBILITY:-0}" == "1" ]]; then
|
|
158
|
-
disp_symbol="$alt_symbol"
|
|
159
|
-
elif [[ "$UI_COLOR" = "1" ]] && [[ -n "$color" ]]; then
|
|
160
|
-
disp_symbol="${color}${symbol}${NORMAL}"
|
|
161
|
-
fi
|
|
162
|
-
|
|
163
|
-
if [[ -n "$detail" ]]; then
|
|
164
|
-
printf " %-6b %-*s %s\n" "$disp_symbol" "$width" "$label" "$detail"
|
|
165
|
-
else
|
|
166
|
-
printf " %-6b %s\n" "$disp_symbol" "$label"
|
|
167
|
-
fi
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
ui_ok() { ui_status "$_GL_OK" "[OK]" "$1" "${2:-}" "$GREEN"; }
|
|
171
|
-
ui_warn() { ui_status "$_GL_WARN" "[WARN]" "$1" "${2:-}" "$YELLOW"; }
|
|
172
|
-
ui_err() { ui_status "$_GL_FAIL" "[FAIL]" "$1" "${2:-}" "$RED"; }
|
|
173
|
-
ui_info() { ui_status "$_GL_INFO" "[INFO]" "$1" "${2:-}" "$GRAY"; }
|
|
174
|
-
ui_meta() { ui_status "$_GL_INFO" "[INFO]" "$1" "${2:-}" "$GRAY" 14; }
|
|
175
|
-
|
|
176
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
177
|
-
# Help / key-value primitives
|
|
178
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
179
|
-
|
|
180
|
-
ui_cmd() {
|
|
181
|
-
local cmd="$1"
|
|
182
|
-
local desc="$2"
|
|
183
|
-
local width="${3:-16}"
|
|
184
|
-
ui_init
|
|
185
|
-
|
|
186
|
-
local glyph="$_GL_INFO"
|
|
187
|
-
if [[ "${DOTFILES_ACCESSIBILITY:-0}" == "1" ]]; then
|
|
188
|
-
glyph="-"
|
|
189
|
-
elif [[ "$UI_COLOR" = "1" ]]; then
|
|
190
|
-
glyph="${GREEN}${_GL_INFO}${NORMAL}"
|
|
191
|
-
fi
|
|
192
|
-
|
|
193
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
194
|
-
printf " %-4b %s%-*s%s %s\n" "$glyph" "$GREEN" "$width" "$cmd" "$NORMAL" "$desc"
|
|
195
|
-
else
|
|
196
|
-
printf " %-4b %-*s %s\n" "$glyph" "$width" "$cmd" "$desc"
|
|
197
|
-
fi
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
ui_bullet() {
|
|
201
|
-
local text="$1"
|
|
202
|
-
ui_init
|
|
203
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
204
|
-
printf " %s%s%s %s\n" "$GRAY" "$_GL_BULLET" "$NORMAL" "$text"
|
|
205
|
-
else
|
|
206
|
-
printf " %s %s\n" "$_GL_BULLET" "$text"
|
|
207
|
-
fi
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
ui_kv() {
|
|
211
|
-
local key="$1"
|
|
212
|
-
local val="$2"
|
|
213
|
-
local width="${3:-14}"
|
|
214
|
-
ui_init
|
|
215
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
216
|
-
printf " %s%-*s%s %s\n" "$BOLD" "$width" "$key" "$NORMAL" "$val"
|
|
217
|
-
else
|
|
218
|
-
printf " %-*s %s\n" "$width" "$key" "$val"
|
|
219
|
-
fi
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
ui_key_value() { ui_kv "$@"; }
|
|
223
|
-
|
|
224
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
225
|
-
# Cursor control
|
|
226
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
227
|
-
|
|
228
|
-
ui_clear_line() { printf '\r\033[K'; }
|
|
229
|
-
ui_hide_cursor() { [[ -t 1 ]] && printf '\033[?25l'; }
|
|
230
|
-
ui_show_cursor() { [[ -t 1 ]] && printf '\033[?25h'; }
|
|
231
|
-
|
|
232
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
233
|
-
# Spinner — non-blocking, runs in background
|
|
234
|
-
#
|
|
235
|
-
# ui_spinner_start "Loading"
|
|
236
|
-
# some_work ...
|
|
237
|
-
# ui_spinner_stop
|
|
238
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
239
|
-
_UI_SPINNER_PID=""
|
|
240
|
-
|
|
241
|
-
ui_spinner_start() {
|
|
242
|
-
local label="${1:-Working}"
|
|
243
|
-
ui_init
|
|
244
|
-
# No animation when non-interactive
|
|
245
|
-
[[ ! -t 1 ]] && {
|
|
246
|
-
printf " %s %s..." "$_GL_INFO" "$label"
|
|
247
|
-
return
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
ui_hide_cursor
|
|
251
|
-
(
|
|
252
|
-
local i=0
|
|
253
|
-
while true; do
|
|
254
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
255
|
-
printf '\r %s%s%s %s ' "$BLUE" "${_GL_SPINNER[$i]}" "$NORMAL" "$label"
|
|
256
|
-
else
|
|
257
|
-
printf '\r %s %s ' "${_GL_SPINNER[$i]}" "$label"
|
|
258
|
-
fi
|
|
259
|
-
i=$(((i + 1) % ${#_GL_SPINNER[@]}))
|
|
260
|
-
sleep 0.08
|
|
261
|
-
done
|
|
262
|
-
) &
|
|
263
|
-
_UI_SPINNER_PID=$!
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
ui_spinner_stop() {
|
|
267
|
-
if [[ -n "$_UI_SPINNER_PID" ]]; then
|
|
268
|
-
kill "$_UI_SPINNER_PID" 2>/dev/null
|
|
269
|
-
wait "$_UI_SPINNER_PID" 2>/dev/null || true
|
|
270
|
-
_UI_SPINNER_PID=""
|
|
271
|
-
fi
|
|
272
|
-
ui_clear_line
|
|
273
|
-
ui_show_cursor
|
|
274
|
-
# The newline is only needed when stdout is NOT a TTY. We must return
|
|
275
|
-
# 0 either way — without the explicit `return 0`, the function's exit
|
|
276
|
-
# status comes from the trailing `[[ ! -t 1 ]] && printf` chain, which
|
|
277
|
-
# is rc=1 on a TTY and breaks every caller running under `set -e`.
|
|
278
|
-
[[ ! -t 1 ]] && printf "\n"
|
|
279
|
-
return 0
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
283
|
-
# Progress bar
|
|
284
|
-
#
|
|
285
|
-
# ui_progress 3 10 # 3/10 complete
|
|
286
|
-
# ui_progress 10 10 # done
|
|
287
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
288
|
-
|
|
289
|
-
ui_progress() {
|
|
290
|
-
local current="${1:?}" total="${2:?}" width="${3:-20}"
|
|
291
|
-
[[ "$total" -eq 0 ]] && return
|
|
292
|
-
ui_init
|
|
293
|
-
|
|
294
|
-
local filled=$((current * width / total))
|
|
295
|
-
local empty=$((width - filled))
|
|
296
|
-
|
|
297
|
-
local bar=""
|
|
298
|
-
local i
|
|
299
|
-
for ((i = 0; i < filled; i++)); do bar+="$_GL_BAR_FILL"; done
|
|
300
|
-
for ((i = 0; i < empty; i++)); do bar+="$_GL_BAR_EMPTY"; done
|
|
301
|
-
|
|
302
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
303
|
-
printf '%s%s%s' "$BLUE" "${bar:0:$filled}" "$NORMAL"
|
|
304
|
-
printf '%s%s%s' "$GRAY" "${bar:$filled}" "$NORMAL"
|
|
305
|
-
else
|
|
306
|
-
printf '%s' "$bar"
|
|
307
|
-
fi
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
311
|
-
# Run a command with spinner + progress + result line
|
|
312
|
-
#
|
|
313
|
-
# ui_run_cmd "Installing rg" 3 10 mise install ripgrep
|
|
314
|
-
# # Shows: ⠙ Installing rg ██████░░░░ 4/10
|
|
315
|
-
# # Then: ✓ Installing rg (or ✗ on failure)
|
|
316
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
317
|
-
|
|
318
|
-
ui_run_cmd() {
|
|
319
|
-
local label="$1" completed="$2" total="$3"
|
|
320
|
-
shift 3
|
|
321
|
-
ui_init
|
|
322
|
-
|
|
323
|
-
# Non-interactive: simple pass/fail line
|
|
324
|
-
if [[ ! -t 1 ]]; then
|
|
325
|
-
if "$@" >/dev/null 2>&1; then
|
|
326
|
-
ui_ok "$label"
|
|
327
|
-
else
|
|
328
|
-
ui_err "$label"
|
|
329
|
-
return 1
|
|
330
|
-
fi
|
|
331
|
-
return 0
|
|
332
|
-
fi
|
|
333
|
-
|
|
334
|
-
local rc_file
|
|
335
|
-
rc_file=$(mktemp)
|
|
336
|
-
trap 'rm -f "$rc_file"' RETURN
|
|
337
|
-
# Run command in background
|
|
338
|
-
(
|
|
339
|
-
"$@" >/dev/null 2>&1
|
|
340
|
-
echo $? >"$rc_file"
|
|
341
|
-
) &
|
|
342
|
-
local pid=$!
|
|
343
|
-
|
|
344
|
-
# Animate spinner while waiting
|
|
345
|
-
ui_hide_cursor
|
|
346
|
-
local fi=0 w=${#total}
|
|
347
|
-
while kill -0 "$pid" 2>/dev/null; do
|
|
348
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
349
|
-
printf '\r %s%s%s Installing %s%s%s ' \
|
|
350
|
-
"$BLUE" "${_GL_SPINNER[$fi]}" "$NORMAL" \
|
|
351
|
-
"$MAGENTA" "$label" "$NORMAL"
|
|
352
|
-
else
|
|
353
|
-
printf '\r %s Installing %s ' "${_GL_SPINNER[$fi]}" "$label"
|
|
354
|
-
fi
|
|
355
|
-
ui_progress "$completed" "$total"
|
|
356
|
-
printf ' %*d/%d ' "$w" "$((completed + 1))" "$total"
|
|
357
|
-
fi=$(((fi + 1) % ${#_GL_SPINNER[@]}))
|
|
358
|
-
sleep 0.08
|
|
359
|
-
done
|
|
360
|
-
wait "$pid" 2>/dev/null
|
|
361
|
-
|
|
362
|
-
# Guard against the rc_file being empty (race between subshell exit
|
|
363
|
-
# and parent read): an unset rc would default to non-numeric "" and
|
|
364
|
-
# fail the `[[ == "0" ]]` check confusingly. Treat empty as failure.
|
|
365
|
-
local rc=""
|
|
366
|
-
[[ -s "$rc_file" ]] && rc="$(<"$rc_file")"
|
|
367
|
-
rm -f "$rc_file"
|
|
368
|
-
rc="${rc:-1}"
|
|
369
|
-
|
|
370
|
-
ui_clear_line
|
|
371
|
-
ui_show_cursor
|
|
372
|
-
if [[ "$rc" == "0" ]]; then
|
|
373
|
-
ui_ok "$label"
|
|
374
|
-
else
|
|
375
|
-
ui_err "$label"
|
|
376
|
-
fi
|
|
377
|
-
return "$rc"
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
381
|
-
# Interactive confirm prompt
|
|
382
|
-
#
|
|
383
|
-
# if ui_confirm "Apply changes?"; then ... fi
|
|
384
|
-
# ui_confirm "Destroy?" "n" # default No
|
|
385
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
386
|
-
|
|
387
|
-
ui_confirm() {
|
|
388
|
-
local prompt="${1:?}" default="${2:-y}"
|
|
389
|
-
ui_init
|
|
390
|
-
|
|
391
|
-
# Non-interactive: use default
|
|
392
|
-
if [[ ! -t 0 ]] || [[ "${DOTFILES_NONINTERACTIVE:-0}" = "1" ]]; then
|
|
393
|
-
[[ "$default" =~ ^[Yy] ]]
|
|
394
|
-
return $?
|
|
395
|
-
fi
|
|
396
|
-
|
|
397
|
-
# gum confirm if available
|
|
398
|
-
if [[ "$UI_ENABLED" = "1" ]]; then
|
|
399
|
-
gum confirm "$prompt"
|
|
400
|
-
return $?
|
|
401
|
-
fi
|
|
402
|
-
|
|
403
|
-
local hint="Y/n"
|
|
404
|
-
[[ "$default" =~ ^[Nn] ]] && hint="y/N"
|
|
405
|
-
|
|
406
|
-
local answer
|
|
407
|
-
printf " %s [%s] " "$prompt" "$hint"
|
|
408
|
-
read -r answer </dev/tty
|
|
409
|
-
answer="${answer:-$default}"
|
|
410
|
-
[[ "$answer" =~ ^[Yy] ]]
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
414
|
-
# Toast — ephemeral status message (error / success / info)
|
|
415
|
-
#
|
|
416
|
-
# ui_toast "success" "Config applied"
|
|
417
|
-
# ui_toast "error" "chezmoi drift detected"
|
|
418
|
-
# ui_toast "warn" "3 optional tools missing"
|
|
419
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
420
|
-
|
|
421
|
-
ui_toast() {
|
|
422
|
-
local level="${1:?}" msg="${2:?}"
|
|
423
|
-
ui_init
|
|
424
|
-
case "$level" in
|
|
425
|
-
success | ok) ui_ok "$msg" ;;
|
|
426
|
-
error | err) ui_err "$msg" ;;
|
|
427
|
-
warn) ui_warn "$msg" ;;
|
|
428
|
-
*) ui_info "$msg" ;;
|
|
429
|
-
esac
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
433
|
-
# Table — fixed-width columnar output
|
|
434
|
-
#
|
|
435
|
-
# ui_table_header "Name" "Status" "Path"
|
|
436
|
-
# ui_table_row "rg" "✓" "~/.local/bin/rg"
|
|
437
|
-
# ui_table_sep
|
|
438
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
439
|
-
_UI_TABLE_WIDTHS=()
|
|
440
|
-
|
|
441
|
-
ui_table_header() {
|
|
442
|
-
ui_init
|
|
443
|
-
_UI_TABLE_WIDTHS=()
|
|
444
|
-
local out=" "
|
|
445
|
-
for col in "$@"; do
|
|
446
|
-
local w=$((${#col} + 4))
|
|
447
|
-
((w < 12)) && w=12
|
|
448
|
-
_UI_TABLE_WIDTHS+=("$w")
|
|
449
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
450
|
-
out+="$(printf '%s%-*s%s' "$BOLD" "$w" "$col" "$NORMAL")"
|
|
451
|
-
else
|
|
452
|
-
out+="$(printf '%-*s' "$w" "$col")"
|
|
453
|
-
fi
|
|
454
|
-
done
|
|
455
|
-
printf '%s\n' "$out"
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
ui_table_row() {
|
|
459
|
-
local out=" " i=0
|
|
460
|
-
for col in "$@"; do
|
|
461
|
-
local w="${_UI_TABLE_WIDTHS[$i]:-16}"
|
|
462
|
-
out+="$(printf '%-*s' "$w" "$col")"
|
|
463
|
-
((i++)) || true
|
|
464
|
-
done
|
|
465
|
-
printf '%s\n' "$out"
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
ui_table_sep() {
|
|
469
|
-
local total=2
|
|
470
|
-
for w in "${_UI_TABLE_WIDTHS[@]}"; do
|
|
471
|
-
((total += w)) || true
|
|
472
|
-
done
|
|
473
|
-
printf ' '
|
|
474
|
-
local i
|
|
475
|
-
for ((i = 0; i < total - 2; i++)); do printf '─'; done
|
|
476
|
-
printf '\n'
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
480
|
-
# Buffered table — accumulates rows then renders via `gum table -p`
|
|
481
|
-
# (rounded borders) when gum is on PATH and stdout is a TTY; falls back
|
|
482
|
-
# to the existing printf-based ui_table_header/row otherwise.
|
|
483
|
-
#
|
|
484
|
-
# ui_table_begin "Tool" "Version" "Source" "Requested"
|
|
485
|
-
# ui_table_add "node" "24.14.0" "~/.dotfiles/mise.toml" "24.14.0"
|
|
486
|
-
# ui_table_add "node" "25.9.0" "" ""
|
|
487
|
-
# ui_table_end
|
|
488
|
-
#
|
|
489
|
-
# Cells may contain anything except ASCII US (0x1f), the internal row
|
|
490
|
-
# separator. Empty cells render as blank in both modes.
|
|
491
|
-
#
|
|
492
|
-
# Environment overrides:
|
|
493
|
-
# DOTFILES_NO_TUI=1 force the printf fallback even if gum is installed
|
|
494
|
-
# NO_COLOR=… standard convention; also forces the fallback
|
|
495
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
496
|
-
_UI_TABLE_HEADERS=()
|
|
497
|
-
_UI_TABLE_ROWS=()
|
|
498
|
-
|
|
499
|
-
ui_table_begin() {
|
|
500
|
-
_UI_TABLE_HEADERS=("$@")
|
|
501
|
-
_UI_TABLE_ROWS=()
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
ui_table_add() {
|
|
505
|
-
if [[ "${#_UI_TABLE_HEADERS[@]}" -eq 0 ]]; then
|
|
506
|
-
return 1
|
|
507
|
-
fi
|
|
508
|
-
local IFS=$'\x1f'
|
|
509
|
-
_UI_TABLE_ROWS+=("$*")
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
ui_table_end() {
|
|
513
|
-
if [[ "${#_UI_TABLE_HEADERS[@]}" -eq 0 ]]; then
|
|
514
|
-
return 0
|
|
515
|
-
fi
|
|
516
|
-
|
|
517
|
-
local use_gum=0
|
|
518
|
-
if command -v gum >/dev/null 2>&1 &&
|
|
519
|
-
[[ -t 1 ]] &&
|
|
520
|
-
[[ "${DOTFILES_NO_TUI:-0}" != "1" ]] &&
|
|
521
|
-
[[ -z "${NO_COLOR:-}" ]]; then
|
|
522
|
-
use_gum=1
|
|
523
|
-
fi
|
|
524
|
-
|
|
525
|
-
if ((use_gum)); then
|
|
526
|
-
local header_row
|
|
527
|
-
local IFS=$'\x1f'
|
|
528
|
-
header_row="${_UI_TABLE_HEADERS[*]}"
|
|
529
|
-
# Charm palette: 212 = hot pink (matches ui_header), 240 = muted grey.
|
|
530
|
-
# Cell colour intentionally left at terminal default so the table
|
|
531
|
-
# reads on both light and dark backgrounds.
|
|
532
|
-
# Override via DOTFILES_TABLE_{BORDER,HEADER}_FG env vars.
|
|
533
|
-
local border_fg="${DOTFILES_TABLE_BORDER_FG:-240}"
|
|
534
|
-
local header_fg="${DOTFILES_TABLE_HEADER_FG:-212}"
|
|
535
|
-
{
|
|
536
|
-
printf '%s\n' "$header_row"
|
|
537
|
-
printf '%s\n' "${_UI_TABLE_ROWS[@]}"
|
|
538
|
-
} | gum table --print \
|
|
539
|
-
--separator=$'\x1f' \
|
|
540
|
-
--border=rounded \
|
|
541
|
-
--border.foreground="$border_fg" \
|
|
542
|
-
--header.foreground="$header_fg" \
|
|
543
|
-
--padding="0 1" 2>/dev/null ||
|
|
544
|
-
_ui_table_printf_fallback
|
|
545
|
-
else
|
|
546
|
-
_ui_table_printf_fallback
|
|
547
|
-
fi
|
|
548
|
-
|
|
549
|
-
_UI_TABLE_HEADERS=()
|
|
550
|
-
_UI_TABLE_ROWS=()
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
_ui_table_printf_fallback() {
|
|
554
|
-
ui_init
|
|
555
|
-
# Pre-scan all buffered rows + headers to compute per-column width so
|
|
556
|
-
# values aren't truncated or collide. Min width 8, +2 padding.
|
|
557
|
-
local ncols="${#_UI_TABLE_HEADERS[@]}"
|
|
558
|
-
local -a widths=()
|
|
559
|
-
local i
|
|
560
|
-
for ((i = 0; i < ncols; i++)); do
|
|
561
|
-
widths[i]="${#_UI_TABLE_HEADERS[i]}"
|
|
562
|
-
done
|
|
563
|
-
local row
|
|
564
|
-
for row in "${_UI_TABLE_ROWS[@]}"; do
|
|
565
|
-
local -a _fields=()
|
|
566
|
-
local IFS=$'\x1f'
|
|
567
|
-
read -ra _fields <<<"$row"
|
|
568
|
-
for ((i = 0; i < ncols; i++)); do
|
|
569
|
-
local len="${#_fields[i]}"
|
|
570
|
-
((len > widths[i])) && widths[i]=$len
|
|
571
|
-
done
|
|
572
|
-
done
|
|
573
|
-
for ((i = 0; i < ncols; i++)); do
|
|
574
|
-
((widths[i] += 2))
|
|
575
|
-
((widths[i] < 8)) && widths[i]=8
|
|
576
|
-
done
|
|
577
|
-
|
|
578
|
-
# Emit header (bold when color available), separator, then rows.
|
|
579
|
-
local out=" "
|
|
580
|
-
for ((i = 0; i < ncols; i++)); do
|
|
581
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
582
|
-
out+="$(printf '%s%-*s%s' "$BOLD" "${widths[i]}" "${_UI_TABLE_HEADERS[i]}" "$NORMAL")"
|
|
583
|
-
else
|
|
584
|
-
out+="$(printf '%-*s' "${widths[i]}" "${_UI_TABLE_HEADERS[i]}")"
|
|
585
|
-
fi
|
|
586
|
-
done
|
|
587
|
-
printf '%s\n' "$out"
|
|
588
|
-
|
|
589
|
-
local total=2
|
|
590
|
-
for ((i = 0; i < ncols; i++)); do ((total += widths[i])); done
|
|
591
|
-
printf ' '
|
|
592
|
-
for ((i = 0; i < total - 2; i++)); do printf '─'; done
|
|
593
|
-
printf '\n'
|
|
594
|
-
|
|
595
|
-
for row in "${_UI_TABLE_ROWS[@]}"; do
|
|
596
|
-
local -a _fields=()
|
|
597
|
-
local IFS=$'\x1f'
|
|
598
|
-
read -ra _fields <<<"$row"
|
|
599
|
-
out=" "
|
|
600
|
-
for ((i = 0; i < ncols; i++)); do
|
|
601
|
-
out+="$(printf '%-*s' "${widths[i]}" "${_fields[i]:-}")"
|
|
602
|
-
done
|
|
603
|
-
printf '%s\n' "$out"
|
|
604
|
-
done
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
608
|
-
# Logo
|
|
609
|
-
# ═══════════════════════════════════════════════════════════════════════
|
|
610
|
-
|
|
611
|
-
ui_logo_dot() {
|
|
612
|
-
local title="${1:-}"
|
|
613
|
-
ui_init
|
|
614
|
-
printf "\n"
|
|
615
|
-
if [[ "${DOTFILES_ACCESSIBILITY:-0}" == "1" ]]; then
|
|
616
|
-
printf "DOTFILES\n"
|
|
617
|
-
elif [[ "$UI_UTF8" = "1" ]]; then
|
|
618
|
-
printf "%s%s DOTFILES %s\n" "${BOLD}${BLUE}" "$_GL_LOGO" "${NORMAL}"
|
|
619
|
-
else
|
|
620
|
-
printf "%sDOTFILES%s\n" "${BOLD}${BLUE}" "${NORMAL}"
|
|
621
|
-
fi
|
|
622
|
-
if [[ -n "$title" ]]; then
|
|
623
|
-
if [[ "$UI_COLOR" = "1" ]]; then
|
|
624
|
-
printf "%s%s%s\n\n" "${GRAY}" "$title" "${NORMAL}"
|
|
625
|
-
else
|
|
626
|
-
printf "%s\n\n" "$title"
|
|
627
|
-
fi
|
|
628
|
-
else
|
|
629
|
-
printf "\n"
|
|
630
|
-
fi
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
ui_product_banner() {
|
|
634
|
-
local title="${1:-Dot}"
|
|
635
|
-
ui_init
|
|
636
|
-
if [[ "${DOTFILES_SHOW_LOGO:-1}" != "1" ]]; then
|
|
637
|
-
return 0
|
|
638
|
-
fi
|
|
639
|
-
if [[ "${DOTFILES_LOGO_PRINTED:-0}" = "1" ]]; then
|
|
640
|
-
return 0
|
|
641
|
-
fi
|
|
642
|
-
ui_logo_dot "$title"
|
|
643
|
-
DOTFILES_LOGO_PRINTED=1
|
|
644
|
-
export DOTFILES_LOGO_PRINTED
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
ui_dot_banner() {
|
|
648
|
-
local section="${1:-Dot}"
|
|
649
|
-
ui_product_banner "Dot • $section"
|
|
650
|
-
}
|