@sebastienrousseau/dotfiles 0.2.520 → 0.2.522
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 +52 -0
- package/LICENSE-APACHE +190 -0
- package/LICENSE-MIT +21 -0
- package/README.md +43 -37
- package/install.sh +76 -10
- package/package.json +7 -7
- package/tools/README.md +49 -0
- package/tools/ci/install-chezmoi-verified.sh +68 -0
- package/docs/.vitepress/reports/localization-readability-audit.md +0 -73
- package/docs/AI.md +0 -179
- package/docs/ARCHITECTURE.md +0 -117
- package/docs/CNAME +0 -1
- package/docs/CONFIG_STRATEGY.md +0 -124
- package/docs/COPYRIGHT +0 -7
- package/docs/ECOSYSTEM.md +0 -220
- package/docs/GOLD-STANDARD-AUDIT.md +0 -352
- package/docs/GOVERNANCE.md +0 -98
- package/docs/MAINTAINERS.md +0 -41
- package/docs/MINIMUM-TOOLCHAIN.md +0 -100
- package/docs/NAMING_CONVENTIONS.md +0 -102
- package/docs/OPENCODE.md +0 -127
- package/docs/README.md +0 -84
- package/docs/STRUCTURE.md +0 -102
- package/docs/adr/ADR-001-ci-cd-pipeline.md +0 -118
- package/docs/adr/ADR-002-shell-performance.md +0 -130
- package/docs/adr/ADR-003-security-first.md +0 -158
- package/docs/adr/ADR-004-cli-architecture.md +0 -171
- package/docs/adr/ADR-005-chezmoi-choice.md +0 -99
- package/docs/adr/ADR-006-shell-selection.md +0 -124
- package/docs/adr/ADR-007-multi-shell-parity.md +0 -62
- package/docs/adr/ADR-008-alias-system-architecture.md +0 -95
- package/docs/adr/ADR-009-wallpaper-driven-theming.md +0 -131
- package/docs/adr/ADR-010-starship-transient-prompt.md +0 -144
- package/docs/adr/ADR-011-nushell-tier3-keep.md +0 -144
- package/docs/adr/ADR-012-ai-fleet-local-proxy.md +0 -79
- package/docs/adr/README.md +0 -40
- package/docs/architecture/AI_COST_OPTIMIZATION.md +0 -144
- package/docs/architecture/ARCHITECTURE.md +0 -20
- package/docs/architecture/INTEROP.md +0 -44
- package/docs/architecture/REPO_LAYOUT.md +0 -241
- package/docs/architecture/WALKTHROUGH.md +0 -86
- package/docs/architecture/fleet-deployment.md +0 -77
- package/docs/archive/EUXIS_2026_REVIEW.md +0 -127
- package/docs/archive/LEGACY_ROADMAP.md +0 -6
- package/docs/archive/MILESTONE_v0.2.493.md +0 -47
- package/docs/archive/PLAN.md +0 -199
- package/docs/archive/REPO_AUDIT.md +0 -31
- package/docs/articles/.pages +0 -6
- package/docs/articles/2026-07-05-custom-mkdocs-material-dark-theme.md +0 -216
- package/docs/articles/2026-07-05-fish-startup-abbr.md +0 -153
- package/docs/articles/2026-07-05-master-to-main-rename-runbook.md +0 -128
- package/docs/articles/index.md +0 -36
- package/docs/guides/INSTALL.md +0 -144
- package/docs/guides/MACOS_ICLOUD_SYMLINKS.md +0 -121
- package/docs/guides/NEOVIM_IDE_GUIDE.md +0 -61
- package/docs/guides/THEMING.md +0 -230
- package/docs/guides/TROUBLESHOOTING.md +0 -176
- package/docs/guides/WSL2_NIX_TROUBLESHOOTING.md +0 -792
- package/docs/index.md +0 -132
- package/docs/interop/A2A.md +0 -39
- package/docs/interop/POWERSHELL.md +0 -102
- package/docs/manual/00-introduction.md +0 -89
- package/docs/manual/01-concepts/01-architecture.md +0 -138
- package/docs/manual/01-concepts/02-trust-model.md +0 -183
- package/docs/manual/01-concepts/03-theme-engine.md +0 -186
- package/docs/manual/01-concepts/04-fleet.md +0 -148
- package/docs/manual/01-concepts/05-self-healing.md +0 -204
- package/docs/manual/02-tutorials/01-first-install.md +0 -197
- package/docs/manual/02-tutorials/02-add-wallpaper.md +0 -216
- package/docs/manual/02-tutorials/03-create-profile.md +0 -244
- package/docs/manual/02-tutorials/04-encrypt-secret.md +0 -281
- package/docs/manual/02-tutorials/05-deploy-fleet.md +0 -283
- package/docs/manual/03-reference/01-dot-cli.md +0 -475
- package/docs/manual/03-reference/02-config-files.md +0 -265
- package/docs/manual/03-reference/03-environment.md +0 -124
- package/docs/manual/03-reference/04-templates.md +0 -190
- package/docs/manual/03-reference/05-feature-flags.md +0 -187
- package/docs/manual/04-cookbook/01-recipes.md +0 -285
- package/docs/manual/04-cookbook/02-troubleshooting.md +0 -351
- package/docs/manual/04-cookbook/03-faq.md +0 -175
- package/docs/manual/05-appendices/A-platform-matrix.md +0 -101
- package/docs/manual/05-appendices/B-security-checklist.md +0 -85
- package/docs/manual/05-appendices/C-glossary.md +0 -40
- package/docs/manual/05-appendices/D-bibliography.md +0 -58
- package/docs/manual/05-appendices/E-license.md +0 -38
- package/docs/manual/_toc.yml +0 -58
- package/docs/manual/command-index.md +0 -175
- package/docs/manual/concept-index.md +0 -170
- package/docs/manual/index.md +0 -66
- package/docs/migration/README.md +0 -81
- package/docs/migration/from-bare-git-repo.md +0 -156
- package/docs/migration/from-gnu-stow.md +0 -165
- package/docs/migration/from-plain-chezmoi.md +0 -148
- package/docs/migration/from-yadm.md +0 -187
- package/docs/operations/ARCHITECTURE_ROADMAP.md +0 -7
- package/docs/operations/ATTESTATION.md +0 -44
- package/docs/operations/CI_CADENCE.md +0 -107
- package/docs/operations/CI_COMPOSITES.md +0 -156
- package/docs/operations/COMPLETIONS.md +0 -123
- package/docs/operations/COVERAGE.md +0 -204
- package/docs/operations/DRIFT.md +0 -107
- package/docs/operations/HARD_AUDIT_2026.md +0 -631
- package/docs/operations/MAINTENANCE.md +0 -63
- package/docs/operations/MANIFEST.md +0 -127
- package/docs/operations/MIGRATION.md +0 -109
- package/docs/operations/OPERATIONS.md +0 -188
- package/docs/operations/PERFORMANCE.md +0 -133
- package/docs/operations/PERFORMANCE_BUDGETS.md +0 -196
- package/docs/operations/REGISTRY.md +0 -90
- package/docs/operations/RELEASE_PIPELINE.md +0 -128
- package/docs/operations/RELIABILITY.md +0 -122
- package/docs/operations/RFC_v0_2_503_reorganization.md +0 -280
- package/docs/operations/ROADMAP.md +0 -10
- package/docs/operations/ROADMAP_2026.md +0 -7
- package/docs/operations/ROADMAP_V0_2_503.md +0 -10
- package/docs/operations/TESTING.md +0 -216
- package/docs/operations/TRACEABILITY.md +0 -44
- package/docs/operations/TRUSTED_AGENT_WORKSTATION.md +0 -65
- package/docs/operations/VERSION_SYNC.md +0 -393
- package/docs/packaging.md +0 -222
- package/docs/reference/ALIASES.md +0 -131
- package/docs/reference/ALIASES_CHEATSHEET.md +0 -32
- package/docs/reference/ALIASES_DEPRECATIONS.md +0 -13
- package/docs/reference/FEATURE-MATRIX.md +0 -646
- package/docs/reference/FEATURES.md +0 -66
- package/docs/reference/FONTS.md +0 -112
- package/docs/reference/POWERSHELL_PARITY.md +0 -82
- package/docs/reference/PROFILES.md +0 -69
- package/docs/reference/SCREENSHOTS.md +0 -121
- package/docs/reference/SCRIPTS.md +0 -71
- package/docs/reference/SUPPORT_MATRIX.md +0 -80
- package/docs/reference/THEMES.md +0 -117
- package/docs/reference/TOOLS.md +0 -110
- package/docs/reference/UTILS.md +0 -243
- package/docs/registry.json +0 -6
- package/docs/schema/dot-env-v1.json +0 -110
- package/docs/schema/dot-registry-v1.json +0 -33
- package/docs/security/AI_ACT_COMPLIANCE.md +0 -94
- package/docs/security/AUDIT_BYPASS.md +0 -103
- package/docs/security/AUTOMATION_SECRETS.md +0 -26
- package/docs/security/CI_EGRESS_ALLOWLIST.md +0 -127
- package/docs/security/CI_PINNING.md +0 -129
- package/docs/security/COMMIT_SIGNING.md +0 -138
- package/docs/security/COMPLIANCE.md +0 -458
- package/docs/security/DEPS_DEV_EXCEPTIONS.md +0 -86
- package/docs/security/DISCLOSURE.md +0 -130
- package/docs/security/ENCRYPTION.md +0 -57
- package/docs/security/FMEA.md +0 -159
- package/docs/security/FUZZING.md +0 -209
- package/docs/security/HISTORY_FILTERING.md +0 -132
- package/docs/security/INCIDENT_RESPONSE.md +0 -579
- package/docs/security/INSTALL_VERIFICATION.md +0 -122
- package/docs/security/KEYS.md +0 -49
- package/docs/security/KEY_ROTATION.md +0 -303
- package/docs/security/MCP_POLICY.md +0 -78
- package/docs/security/POLICY_RELEASES.md +0 -37
- package/docs/security/README.md +0 -28
- package/docs/security/SCORECARD.md +0 -195
- package/docs/security/SECRETS.md +0 -158
- package/docs/security/SECURITY.md +0 -45
- package/docs/security/SECURITY_CHECKLIST.md +0 -55
- package/docs/security/SHELL_EXEMPTIONS.md +0 -145
- package/docs/security/SOUP_REGISTER.md +0 -36
- package/docs/security/THREAT_MODEL.md +0 -130
- package/docs/security/VERIFICATION_VALIDATION.md +0 -228
- package/docs/security/VERIFY_RELEASE.md +0 -201
- package/docs/security/security-pubkey.asc +0 -15
- package/docs/stylesheets/extra.css +0 -444
- package/docs/themes/README.md +0 -10
- package/docs/themes/VISUAL_INTEGRITY_REPORT.md +0 -30
- package/docs/themes/hero-shot.svg +0 -78
- package/scripts/README.md +0 -123
- package/scripts/ci/check-copyright-headers.sh +0 -8
- package/scripts/ci/check-shell-preamble.sh +0 -8
- package/scripts/ci/guard-gitleaks-checkout.sh +0 -8
- package/scripts/demo/record.sh +0 -43
- package/scripts/diagnostics/a2a-conformance.sh +0 -163
- package/scripts/diagnostics/alias-governance.sh +0 -165
- package/scripts/diagnostics/aliases-cheatsheet.sh +0 -74
- package/scripts/diagnostics/aliases-manifest.sh +0 -77
- package/scripts/diagnostics/attest-verify.sh +0 -147
- package/scripts/diagnostics/benchmark.sh +0 -408
- package/scripts/diagnostics/conflicts.sh +0 -73
- package/scripts/diagnostics/doctor-unified.sh +0 -43
- package/scripts/diagnostics/doctor.sh +0 -797
- package/scripts/diagnostics/drift-dashboard.sh +0 -203
- package/scripts/diagnostics/health.sh +0 -656
- package/scripts/diagnostics/history-analysis.sh +0 -86
- package/scripts/diagnostics/mcp-doctor.sh +0 -582
- package/scripts/diagnostics/perf.sh +0 -453
- package/scripts/diagnostics/scorecard.sh +0 -120
- package/scripts/diagnostics/secret-governance.sh +0 -65
- package/scripts/diagnostics/security-score.sh +0 -467
- package/scripts/diagnostics/smoke-test.sh +0 -88
- package/scripts/diagnostics/snapshot.sh +0 -90
- package/scripts/diagnostics/verify.sh +0 -108
- package/scripts/diagnostics/verify_state.sh +0 -73
- package/scripts/diagnostics/version-locks.sh +0 -94
- package/scripts/diagnostics/workstation-attestation.sh +0 -212
- package/scripts/dot/commands/agent.sh +0 -535
- package/scripts/dot/commands/agents.sh +0 -352
- package/scripts/dot/commands/ai.sh +0 -600
- package/scripts/dot/commands/aliases.sh +0 -277
- package/scripts/dot/commands/appearance.sh +0 -110
- package/scripts/dot/commands/completion.sh +0 -171
- package/scripts/dot/commands/core.sh +0 -217
- package/scripts/dot/commands/diagnostics.sh +0 -265
- package/scripts/dot/commands/env-emit.sh +0 -203
- package/scripts/dot/commands/fleet.sh +0 -711
- package/scripts/dot/commands/init.sh +0 -185
- package/scripts/dot/commands/lint.sh +0 -208
- package/scripts/dot/commands/manual.sh +0 -169
- package/scripts/dot/commands/meta.sh +0 -438
- package/scripts/dot/commands/patterns.sh +0 -55
- package/scripts/dot/commands/registry.sh +0 -455
- package/scripts/dot/commands/restore.sh +0 -232
- package/scripts/dot/commands/secrets.sh +0 -296
- package/scripts/dot/commands/security.sh +0 -102
- package/scripts/dot/commands/tools.sh +0 -570
- package/scripts/dot/data/alias-deprecations.tsv +0 -2
- package/scripts/dot/powershell/Dot.psm1 +0 -319
- package/scripts/fonts/install-nerd-fonts.sh +0 -75
- package/scripts/fonts/patch-fonts.sh +0 -36
- package/scripts/git-hooks/install.sh +0 -12
- package/scripts/git-hooks/pre-commit +0 -12
- package/scripts/git-hooks/pre-commit-audit.sh +0 -146
- package/scripts/git-hooks/pre-push +0 -105
- package/scripts/git-hooks/prepare-commit-msg +0 -29
- package/scripts/lib/secrets_provider.sh +0 -200
- package/scripts/nvim/headless-upgrade.lua +0 -81
- package/scripts/ops/ai-setup.sh +0 -71
- package/scripts/ops/bundle.sh +0 -104
- package/scripts/ops/chaos.sh +0 -50
- package/scripts/ops/chezmoi-apply.sh +0 -333
- package/scripts/ops/chezmoi-diff.sh +0 -16
- package/scripts/ops/chezmoi-remove.sh +0 -46
- package/scripts/ops/chezmoi-update.sh +0 -67
- package/scripts/ops/heal-chezmoi.sh +0 -87
- package/scripts/ops/heal-system.sh +0 -129
- package/scripts/ops/heal-tools.sh +0 -297
- package/scripts/ops/heal.sh +0 -223
- package/scripts/ops/post-apply-repair.sh +0 -107
- package/scripts/ops/prewarm.sh +0 -128
- package/scripts/ops/release.sh +0 -262
- package/scripts/ops/rollback.sh +0 -613
- package/scripts/ops/setup.sh +0 -138
- package/scripts/ops/teleport.sh +0 -34
- package/scripts/qa/check-feature-matrix.sh +0 -296
- package/scripts/qa/check-version-consistency.sh +0 -12
- package/scripts/qa/coverage-baseline.sh +0 -61
- package/scripts/qa/docs-coverage.sh +0 -118
- package/scripts/qa/examples-coverage.sh +0 -94
- package/scripts/qa/powershell-contract.ps1 +0 -95
- package/scripts/qa/reliability-audit.sh +0 -139
- package/scripts/qa/scorecard-snapshot.sh +0 -128
- package/scripts/qa/traceability-coverage.sh +0 -124
- package/scripts/qa/validate-examples.sh +0 -90
- package/scripts/qa/wsl-contract.sh +0 -12
- package/scripts/secrets/age-init.sh +0 -82
- package/scripts/secrets/create-secrets-file.sh +0 -46
- package/scripts/secrets/encrypt-ssh-key.sh +0 -44
- package/scripts/security/backup.sh +0 -58
- package/scripts/security/check-disclosure-key-expiry.sh +0 -111
- package/scripts/security/dns-doh.sh +0 -52
- package/scripts/security/encryption-check.sh +0 -55
- package/scripts/security/enforce-policies.sh +0 -552
- package/scripts/security/firewall.sh +0 -91
- package/scripts/security/lock-configs.sh +0 -67
- package/scripts/security/lock-screen.sh +0 -56
- package/scripts/security/manage-secrets.sh +0 -429
- package/scripts/security/ssh-cert.sh +0 -204
- package/scripts/security/telemetry-kill.sh +0 -51
- package/scripts/security/usb-safety.sh +0 -52
- package/scripts/theme/apply-gnome-theme.sh +0 -333
- package/scripts/theme/extract-heic-frames.sh +0 -115
- package/scripts/theme/extract-theme.py +0 -1020
- package/scripts/theme/install-boot-logo.sh +0 -63
- package/scripts/theme/install-catppuccin-themes.sh +0 -371
- package/scripts/theme/install-cursors.sh +0 -26
- package/scripts/theme/install-file-icons.sh +0 -27
- package/scripts/theme/install-grub-theme.sh +0 -62
- package/scripts/theme/install-lock-icon.sh +0 -31
- package/scripts/theme/merge-wallpaper.sh +0 -146
- package/scripts/theme/rebuild-themes.sh +0 -603
- package/scripts/theme/switch.sh +0 -476
- package/scripts/theme/wallpaper-rotate.sh +0 -137
- package/scripts/theme/wallpaper-sync.sh +0 -690
- package/scripts/tools/cmatrix.sh +0 -22
- package/scripts/tools/detect-collisions.py +0 -103
- package/scripts/tools/emoji-picker.sh +0 -49
- package/scripts/tools/figlet-banner.sh +0 -19
- package/scripts/tools/log-rotate.sh +0 -31
- package/scripts/tools/lolcat-wrap.sh +0 -20
- package/scripts/tools/pipes.sh +0 -49
- package/scripts/tuning/linux.sh +0 -186
- package/scripts/tuning/macos.sh +0 -56
- package/scripts/uninstall.sh +0 -86
- package/scripts/verify-release-versions +0 -156
- package/scripts/version-sync.sh +0 -714
- package/templates/chezmoi-data/geekom-a9.toml.example +0 -21
- package/templates/chezmoi-data/mac-m1.toml.example +0 -16
- package/templates/chezmoi-data/mac-t2-linux.toml.example +0 -21
- package/templates/chezmoi-data/surface-pro-7p.toml.example +0 -21
- package/templates/projects/go/.github/workflows/ci.yml +0 -31
- package/templates/projects/go/README.md +0 -7
- package/templates/projects/go/cmd/__PROJECT_NAME__/main.go +0 -8
- package/templates/projects/go/go.mod +0 -3
- package/templates/projects/go/go.sum +0 -0
- package/templates/projects/molecule/README.md +0 -7
- package/templates/projects/molecule/converge.yml +0 -7
- package/templates/projects/molecule/molecule.yml +0 -16
- package/templates/projects/node/.github/workflows/ci.yml +0 -30
- package/templates/projects/node/README.md +0 -7
- package/templates/projects/node/package-lock.json +0 -12
- package/templates/projects/node/package.json +0 -10
- package/templates/projects/node/src/index.js +0 -3
- package/templates/projects/packer/README.md +0 -15
- package/templates/projects/packer/main.pkr.hcl +0 -15
- package/templates/projects/python/.github/workflows/ci.yml +0 -34
- package/templates/projects/python/README.md +0 -7
- package/templates/projects/python/pyproject.toml +0 -25
- package/templates/projects/python/src/__PROJECT_NAME__/__init__.py +0 -2
- package/templates/projects/python/tests/test_basic.py +0 -3
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
3
|
-
# Copyright (c) 2015-2026 Sebastien Rousseau
|
|
4
|
-
# shellcheck shell=bash
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
# ssh-cert.sh — Short-lived SSH certificate management
|
|
8
|
-
#
|
|
9
|
-
# Supports step-ca (Smallstep) and ssh-keygen-based CA workflows.
|
|
10
|
-
# Short-lived certificates reduce the blast radius of key compromise
|
|
11
|
-
# by expiring automatically (default: 16 hours).
|
|
12
|
-
#
|
|
13
|
-
# Usage:
|
|
14
|
-
# dot ssh-cert issue [--ttl 16h] [--principal user]
|
|
15
|
-
# dot ssh-cert status
|
|
16
|
-
# dot ssh-cert revoke
|
|
17
|
-
|
|
18
|
-
# ---------- configuration -------------------------------------------------- #
|
|
19
|
-
|
|
20
|
-
SSH_DIR="${HOME}/.ssh"
|
|
21
|
-
CERT_FILE="${SSH_DIR}/id_ed25519-cert.pub"
|
|
22
|
-
KEY_FILE="${SSH_DIR}/id_ed25519"
|
|
23
|
-
DEFAULT_TTL="${SSH_CERT_TTL:-16h}"
|
|
24
|
-
DEFAULT_PRINCIPAL="${SSH_CERT_PRINCIPAL:-${USER}}"
|
|
25
|
-
CA_URL="${SSH_CERT_CA_URL:-}"
|
|
26
|
-
CA_PROVISIONER="${SSH_CERT_CA_PROVISIONER:-}"
|
|
27
|
-
|
|
28
|
-
# ---------- helpers -------------------------------------------------------- #
|
|
29
|
-
|
|
30
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
31
|
-
# shellcheck source=../../lib/dot/ui.sh
|
|
32
|
-
# shellcheck disable=SC1091
|
|
33
|
-
source "$SCRIPT_DIR/../../lib/dot/ui.sh"
|
|
34
|
-
ui_init
|
|
35
|
-
|
|
36
|
-
info() { ui_info "ssh-cert" "$*"; }
|
|
37
|
-
warn() { ui_warn "ssh-cert" "$*"; }
|
|
38
|
-
error() {
|
|
39
|
-
ui_err "ssh-cert" "$*"
|
|
40
|
-
exit 1
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
check_key() {
|
|
44
|
-
if [[ ! -f "$KEY_FILE" ]]; then
|
|
45
|
-
error "SSH key not found at $KEY_FILE. Generate one with: ssh-keygen -t ed25519"
|
|
46
|
-
fi
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
# ---------- issue ---------------------------------------------------------- #
|
|
50
|
-
|
|
51
|
-
cmd_issue() {
|
|
52
|
-
local ttl="$DEFAULT_TTL"
|
|
53
|
-
local principal="$DEFAULT_PRINCIPAL"
|
|
54
|
-
|
|
55
|
-
while [[ $# -gt 0 ]]; do
|
|
56
|
-
case "$1" in
|
|
57
|
-
--ttl)
|
|
58
|
-
ttl="$2"
|
|
59
|
-
shift 2
|
|
60
|
-
;;
|
|
61
|
-
--principal)
|
|
62
|
-
principal="$2"
|
|
63
|
-
shift 2
|
|
64
|
-
;;
|
|
65
|
-
*) error "Unknown option: $1" ;;
|
|
66
|
-
esac
|
|
67
|
-
done
|
|
68
|
-
|
|
69
|
-
check_key
|
|
70
|
-
|
|
71
|
-
# Method 1: step-ca (Smallstep) — preferred for production
|
|
72
|
-
if command -v step >/dev/null 2>&1 && [[ -n "$CA_URL" ]]; then
|
|
73
|
-
info "Requesting certificate from step-ca ($CA_URL)..."
|
|
74
|
-
local step_args=(ssh certificate "$principal" "$KEY_FILE"
|
|
75
|
-
--sign
|
|
76
|
-
--not-after "$ttl"
|
|
77
|
-
--ca-url "$CA_URL"
|
|
78
|
-
--force
|
|
79
|
-
)
|
|
80
|
-
if [[ -n "$CA_PROVISIONER" ]]; then
|
|
81
|
-
step_args+=(--provisioner "$CA_PROVISIONER")
|
|
82
|
-
fi
|
|
83
|
-
step "${step_args[@]}"
|
|
84
|
-
info "Certificate issued:"
|
|
85
|
-
step ssh inspect "$CERT_FILE"
|
|
86
|
-
return 0
|
|
87
|
-
fi
|
|
88
|
-
|
|
89
|
-
# Method 2: ssh-keygen with a local CA (for dev/testing)
|
|
90
|
-
local ca_key="${SSH_DIR}/ca_key"
|
|
91
|
-
if [[ ! -f "$ca_key" ]]; then
|
|
92
|
-
warn "No step-ca configured and no local CA key found."
|
|
93
|
-
echo ""
|
|
94
|
-
echo "To use short-lived SSH certificates, choose one of:"
|
|
95
|
-
echo ""
|
|
96
|
-
echo " Option A: Smallstep step-ca (recommended for production)"
|
|
97
|
-
echo " 1. Install: brew install step / sudo pacman -S step-cli step-ca"
|
|
98
|
-
echo " 2. Initialize CA: step ca init --name 'My CA' --provisioner admin"
|
|
99
|
-
echo " 3. Start CA: step-ca \$(step path)/config/ca.json"
|
|
100
|
-
echo " 4. Configure: export SSH_CERT_CA_URL=https://ca.example.com"
|
|
101
|
-
echo " 5. Run: dot ssh-cert issue"
|
|
102
|
-
echo ""
|
|
103
|
-
echo " Option B: Local CA key (for development/testing)"
|
|
104
|
-
echo " 1. Generate CA: ssh-keygen -t ed25519 -f ~/.ssh/ca_key -C 'local-ca'"
|
|
105
|
-
echo " 2. Run: dot ssh-cert issue"
|
|
106
|
-
echo ""
|
|
107
|
-
echo " Environment variables:"
|
|
108
|
-
echo " SSH_CERT_CA_URL step-ca server URL"
|
|
109
|
-
echo " SSH_CERT_CA_PROVISIONER step-ca provisioner name"
|
|
110
|
-
echo " SSH_CERT_TTL Certificate lifetime (default: 16h)"
|
|
111
|
-
echo " SSH_CERT_PRINCIPAL Certificate principal (default: \$USER)"
|
|
112
|
-
return 1
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
info "Signing with local CA key ($ca_key)..."
|
|
116
|
-
info "TTL: $ttl, Principal: $principal"
|
|
117
|
-
|
|
118
|
-
# Parse TTL to seconds for validity
|
|
119
|
-
local validity="-${ttl}:+${ttl}"
|
|
120
|
-
|
|
121
|
-
ssh-keygen \
|
|
122
|
-
-s "$ca_key" \
|
|
123
|
-
-I "${principal}@$(hostname)-$(date +%s)" \
|
|
124
|
-
-n "$principal" \
|
|
125
|
-
-V "$validity" \
|
|
126
|
-
"${KEY_FILE}.pub"
|
|
127
|
-
|
|
128
|
-
info "Certificate issued:"
|
|
129
|
-
ssh-keygen -L -f "$CERT_FILE"
|
|
130
|
-
info "Expires automatically after $ttl"
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
# ---------- status --------------------------------------------------------- #
|
|
134
|
-
|
|
135
|
-
cmd_status() {
|
|
136
|
-
if [[ ! -f "$CERT_FILE" ]]; then
|
|
137
|
-
info "No SSH certificate found at $CERT_FILE"
|
|
138
|
-
return 0
|
|
139
|
-
fi
|
|
140
|
-
|
|
141
|
-
info "Current certificate:"
|
|
142
|
-
ssh-keygen -L -f "$CERT_FILE"
|
|
143
|
-
|
|
144
|
-
# Check expiry
|
|
145
|
-
local valid_to
|
|
146
|
-
valid_to=$(ssh-keygen -L -f "$CERT_FILE" 2>/dev/null | grep "Valid:" | sed 's/.*to //')
|
|
147
|
-
if [[ -n "$valid_to" ]]; then
|
|
148
|
-
local expiry_epoch
|
|
149
|
-
expiry_epoch=$(date -d "$valid_to" +%s 2>/dev/null || date -j -f "%Y-%m-%dT%H:%M:%S" "$valid_to" +%s 2>/dev/null || echo 0)
|
|
150
|
-
local now_epoch
|
|
151
|
-
now_epoch=$(date +%s)
|
|
152
|
-
if ((expiry_epoch > 0 && expiry_epoch < now_epoch)); then
|
|
153
|
-
warn "Certificate has EXPIRED"
|
|
154
|
-
return 1
|
|
155
|
-
else
|
|
156
|
-
local remaining=$(((expiry_epoch - now_epoch) / 3600))
|
|
157
|
-
info "Certificate valid for ~${remaining}h"
|
|
158
|
-
fi
|
|
159
|
-
fi
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
# ---------- revoke --------------------------------------------------------- #
|
|
163
|
-
|
|
164
|
-
cmd_revoke() {
|
|
165
|
-
if [[ ! -f "$CERT_FILE" ]]; then
|
|
166
|
-
info "No certificate to revoke"
|
|
167
|
-
return 0
|
|
168
|
-
fi
|
|
169
|
-
|
|
170
|
-
# Step-ca revocation
|
|
171
|
-
if command -v step >/dev/null 2>&1 && [[ -n "$CA_URL" ]]; then
|
|
172
|
-
info "Revoking certificate via step-ca..."
|
|
173
|
-
step ssh revoke "$CERT_FILE" --ca-url "$CA_URL" || true
|
|
174
|
-
fi
|
|
175
|
-
|
|
176
|
-
# Local removal
|
|
177
|
-
rm -f "$CERT_FILE"
|
|
178
|
-
info "Certificate removed: $CERT_FILE"
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
# ---------- main ----------------------------------------------------------- #
|
|
182
|
-
|
|
183
|
-
subcommand="${1:-}"
|
|
184
|
-
shift 2>/dev/null || true
|
|
185
|
-
|
|
186
|
-
case "$subcommand" in
|
|
187
|
-
issue) cmd_issue "$@" ;;
|
|
188
|
-
status) cmd_status ;;
|
|
189
|
-
revoke) cmd_revoke ;;
|
|
190
|
-
*)
|
|
191
|
-
echo "Usage: dot ssh-cert <command>"
|
|
192
|
-
echo ""
|
|
193
|
-
echo "Commands:"
|
|
194
|
-
echo " issue [--ttl 16h] [--principal user] Request a short-lived certificate"
|
|
195
|
-
echo " status Show current certificate status"
|
|
196
|
-
echo " revoke Revoke and remove certificate"
|
|
197
|
-
echo ""
|
|
198
|
-
echo "Environment:"
|
|
199
|
-
echo " SSH_CERT_CA_URL step-ca server URL (enables Smallstep mode)"
|
|
200
|
-
echo " SSH_CERT_CA_PROVISIONER step-ca provisioner name"
|
|
201
|
-
echo " SSH_CERT_TTL Certificate lifetime (default: 16h)"
|
|
202
|
-
echo " SSH_CERT_PRINCIPAL Certificate principal (default: \$USER)"
|
|
203
|
-
;;
|
|
204
|
-
esac
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
3
|
-
# Copyright (c) 2015-2026 Sebastien Rousseau
|
|
4
|
-
set -euo pipefail
|
|
5
|
-
|
|
6
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
-
# shellcheck source=../../lib/dot/ui.sh
|
|
8
|
-
# shellcheck disable=SC1091
|
|
9
|
-
source "$SCRIPT_DIR/../../lib/dot/ui.sh"
|
|
10
|
-
# shellcheck source=../../lib/dot/platform.sh
|
|
11
|
-
# shellcheck disable=SC1091
|
|
12
|
-
source "$SCRIPT_DIR/../../lib/dot/platform.sh"
|
|
13
|
-
|
|
14
|
-
DRY_RUN=0
|
|
15
|
-
for arg in "$@"; do
|
|
16
|
-
case "$arg" in --dry-run | -n) DRY_RUN=1 ;; esac
|
|
17
|
-
done
|
|
18
|
-
_run_cmd() {
|
|
19
|
-
if [[ "$DRY_RUN" -eq 1 ]]; then ui_info "[dry-run]" "$*"; else "$@"; fi
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
ui_init
|
|
23
|
-
ui_header "Telemetry"
|
|
24
|
-
|
|
25
|
-
if [[ "$DRY_RUN" -eq 1 ]]; then
|
|
26
|
-
ui_info "Mode" "dry-run (no changes will be made)"
|
|
27
|
-
elif [ "${DOTFILES_TELEMETRY:-}" != "1" ]; then
|
|
28
|
-
ui_warn "Telemetry" "disabled by default"
|
|
29
|
-
ui_info "Re-run" "DOTFILES_TELEMETRY=1"
|
|
30
|
-
exit 1
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
case "$(dot_platform_id)" in
|
|
34
|
-
linux | wsl)
|
|
35
|
-
ui_info "Disabling" "Ubuntu crash reporting (whoopsie/apport)"
|
|
36
|
-
_run_cmd sudo systemctl disable --now whoopsie 2>/dev/null || true
|
|
37
|
-
_run_cmd sudo systemctl disable --now apport 2>/dev/null || true
|
|
38
|
-
_run_cmd sudo systemctl mask apport 2>/dev/null || true
|
|
39
|
-
ui_info "Disabling" "popularity-contest"
|
|
40
|
-
_run_cmd sudo systemctl disable --now popularity-contest 2>/dev/null || true
|
|
41
|
-
;;
|
|
42
|
-
macos)
|
|
43
|
-
ui_info "Disabling" "macOS analytics"
|
|
44
|
-
_run_cmd sudo defaults write /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist AutoSubmit -bool false || true
|
|
45
|
-
_run_cmd sudo defaults write /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist ThirdPartyDataSubmit -bool false || true
|
|
46
|
-
;;
|
|
47
|
-
*)
|
|
48
|
-
ui_err "Unsupported OS" "telemetry kill"
|
|
49
|
-
exit 1
|
|
50
|
-
;;
|
|
51
|
-
esac
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
3
|
-
# Copyright (c) 2015-2026 Sebastien Rousseau
|
|
4
|
-
set -euo pipefail
|
|
5
|
-
|
|
6
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
-
# shellcheck source=../../lib/dot/ui.sh
|
|
8
|
-
# shellcheck disable=SC1091
|
|
9
|
-
source "$SCRIPT_DIR/../../lib/dot/ui.sh"
|
|
10
|
-
# shellcheck source=../../lib/dot/platform.sh
|
|
11
|
-
# shellcheck disable=SC1091
|
|
12
|
-
source "$SCRIPT_DIR/../../lib/dot/platform.sh"
|
|
13
|
-
|
|
14
|
-
DRY_RUN=0
|
|
15
|
-
for arg in "$@"; do
|
|
16
|
-
case "$arg" in --dry-run | -n) DRY_RUN=1 ;; esac
|
|
17
|
-
done
|
|
18
|
-
_run_cmd() {
|
|
19
|
-
if [[ "$DRY_RUN" -eq 1 ]]; then ui_info "[dry-run]" "$*"; else "$@"; fi
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
ui_init
|
|
23
|
-
ui_header "USB Safety"
|
|
24
|
-
|
|
25
|
-
if [[ "$DRY_RUN" -eq 1 ]]; then
|
|
26
|
-
ui_info "Mode" "dry-run (no changes will be made)"
|
|
27
|
-
elif [ "${DOTFILES_USB_SAFETY:-}" != "1" ]; then
|
|
28
|
-
ui_warn "USB safety" "disabled by default"
|
|
29
|
-
ui_info "Re-run" "DOTFILES_USB_SAFETY=1"
|
|
30
|
-
exit 1
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
case "$(dot_platform_id)" in
|
|
34
|
-
linux | wsl)
|
|
35
|
-
if command -v gsettings >/dev/null; then
|
|
36
|
-
ui_info "Disabling" "GNOME automount for removable media"
|
|
37
|
-
_run_cmd gsettings set org.gnome.desktop.media-handling automount false || true
|
|
38
|
-
_run_cmd gsettings set org.gnome.desktop.media-handling automount-open false || true
|
|
39
|
-
else
|
|
40
|
-
ui_err "gsettings" "not found"
|
|
41
|
-
exit 1
|
|
42
|
-
fi
|
|
43
|
-
;;
|
|
44
|
-
macos)
|
|
45
|
-
ui_info "macOS" "no CLI toggle for USB automount"
|
|
46
|
-
ui_info "Use" "System Settings > General > Login Items > External disks"
|
|
47
|
-
;;
|
|
48
|
-
*)
|
|
49
|
-
ui_err "Unsupported OS" "USB safety"
|
|
50
|
-
exit 1
|
|
51
|
-
;;
|
|
52
|
-
esac
|
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
3
|
-
# Copyright (c) 2015-2026 Sebastien Rousseau
|
|
4
|
-
## Apply GNOME Theme — Apply Catppuccin themes to GNOME desktop.
|
|
5
|
-
##
|
|
6
|
-
## Configures GTK theme, icon theme, cursor theme, shell theme,
|
|
7
|
-
## fonts, and wallpaper using gsettings.
|
|
8
|
-
##
|
|
9
|
-
## # Requirements
|
|
10
|
-
## - gsettings: GNOME settings tool
|
|
11
|
-
## - gnome-extensions (optional): For shell themes
|
|
12
|
-
## - User Themes extension (optional): For custom shell themes
|
|
13
|
-
##
|
|
14
|
-
## # Usage
|
|
15
|
-
## apply-gnome-theme.sh catppuccin-mocha # Apply dark theme
|
|
16
|
-
## apply-gnome-theme.sh catppuccin-latte # Apply light theme
|
|
17
|
-
## apply-gnome-theme.sh current # Show current theme
|
|
18
|
-
## apply-gnome-theme.sh backup # Backup current settings
|
|
19
|
-
##
|
|
20
|
-
## # Platform Notes
|
|
21
|
-
## - GNOME 42+: Full color-scheme support
|
|
22
|
-
## - Older GNOME: Color scheme setting skipped
|
|
23
|
-
|
|
24
|
-
set -euo pipefail
|
|
25
|
-
|
|
26
|
-
THEME_NAME="${1:-}"
|
|
27
|
-
|
|
28
|
-
if [ -z "$THEME_NAME" ]; then
|
|
29
|
-
echo "Usage: $0 <theme-name>"
|
|
30
|
-
echo "Available themes: catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha"
|
|
31
|
-
exit 1
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
# Colors for output (respect NO_COLOR: https://no-color.org)
|
|
35
|
-
if [[ -z "${NO_COLOR:-}" ]] && [[ -t 1 ]]; then
|
|
36
|
-
RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m'
|
|
37
|
-
BLUE='\033[0;34m' NC='\033[0m'
|
|
38
|
-
else
|
|
39
|
-
RED='' GREEN='' YELLOW='' BLUE='' NC=''
|
|
40
|
-
fi
|
|
41
|
-
|
|
42
|
-
log() {
|
|
43
|
-
printf '%b\n' "${BLUE}[GNOME]${NC} $1"
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
warn() {
|
|
47
|
-
printf '%b\n' "${YELLOW}[WARN]${NC} $1"
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
error() {
|
|
51
|
-
printf '%b\n' "${RED}[ERROR]${NC} $1"
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
success() {
|
|
55
|
-
printf '%b\n' "${GREEN}[SUCCESS]${NC} $1"
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
# Check if we're running GNOME
|
|
59
|
-
if [ "${XDG_CURRENT_DESKTOP:-}" != "GNOME" ] && [ "${XDG_SESSION_DESKTOP:-}" != "gnome" ]; then
|
|
60
|
-
warn "Not running GNOME desktop. Some settings may not apply."
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
# Function to check if gsettings is available
|
|
64
|
-
check_gsettings() {
|
|
65
|
-
if ! command -v gsettings &>/dev/null; then
|
|
66
|
-
error "gsettings command not found. Please install GLib development tools."
|
|
67
|
-
exit 1
|
|
68
|
-
fi
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
# Function to apply Catppuccin theme settings
|
|
72
|
-
apply_catppuccin_theme() {
|
|
73
|
-
local theme="$1"
|
|
74
|
-
local gtk_theme=""
|
|
75
|
-
local shell_theme=""
|
|
76
|
-
local icon_theme=""
|
|
77
|
-
local cursor_theme="Adwaita"
|
|
78
|
-
local color_scheme="prefer-light"
|
|
79
|
-
|
|
80
|
-
case "$theme" in
|
|
81
|
-
catppuccin-latte)
|
|
82
|
-
gtk_theme="Catppuccin-Latte-Standard-Blue-Light"
|
|
83
|
-
shell_theme="Catppuccin-Latte"
|
|
84
|
-
icon_theme="Papirus-Light"
|
|
85
|
-
cursor_theme="Catppuccin-Latte-Blue"
|
|
86
|
-
color_scheme="prefer-light"
|
|
87
|
-
;;
|
|
88
|
-
catppuccin-frappe)
|
|
89
|
-
gtk_theme="Catppuccin-Frappe-Standard-Blue-Dark"
|
|
90
|
-
shell_theme="Catppuccin-Frappe"
|
|
91
|
-
icon_theme="Papirus-Dark"
|
|
92
|
-
cursor_theme="Catppuccin-Frappe-Blue"
|
|
93
|
-
color_scheme="prefer-dark"
|
|
94
|
-
;;
|
|
95
|
-
catppuccin-macchiato)
|
|
96
|
-
gtk_theme="Catppuccin-Macchiato-Standard-Blue-Dark"
|
|
97
|
-
shell_theme="Catppuccin-Macchiato"
|
|
98
|
-
icon_theme="Papirus-Dark"
|
|
99
|
-
cursor_theme="Catppuccin-Macchiato-Blue"
|
|
100
|
-
color_scheme="prefer-dark"
|
|
101
|
-
;;
|
|
102
|
-
catppuccin-mocha)
|
|
103
|
-
gtk_theme="Catppuccin-Mocha-Standard-Blue-Dark"
|
|
104
|
-
shell_theme="Catppuccin-Mocha"
|
|
105
|
-
icon_theme="Papirus-Dark"
|
|
106
|
-
cursor_theme="Catppuccin-Mocha-Blue"
|
|
107
|
-
color_scheme="prefer-dark"
|
|
108
|
-
;;
|
|
109
|
-
*)
|
|
110
|
-
# Non-Catppuccin themes - use fallback
|
|
111
|
-
if [[ "$theme" == *"-dark"* ]] || [[ "$theme" == *"-night"* ]] || [[ "$theme" == *"-storm"* ]] || [[ "$theme" == *"-moon"* ]] || [[ "$theme" == *"-mocha"* ]]; then
|
|
112
|
-
gtk_theme="Adwaita-dark"
|
|
113
|
-
shell_theme=""
|
|
114
|
-
icon_theme="Papirus-Dark"
|
|
115
|
-
color_scheme="prefer-dark"
|
|
116
|
-
else
|
|
117
|
-
gtk_theme="Adwaita"
|
|
118
|
-
shell_theme=""
|
|
119
|
-
icon_theme="Papirus"
|
|
120
|
-
color_scheme="prefer-light"
|
|
121
|
-
fi
|
|
122
|
-
;;
|
|
123
|
-
esac
|
|
124
|
-
|
|
125
|
-
log "Applying GNOME theme: $theme"
|
|
126
|
-
|
|
127
|
-
# Apply GTK theme
|
|
128
|
-
log "Setting GTK theme to: $gtk_theme"
|
|
129
|
-
gsettings set org.gnome.desktop.interface gtk-theme "$gtk_theme"
|
|
130
|
-
|
|
131
|
-
# Apply icon theme
|
|
132
|
-
log "Setting icon theme to: $icon_theme"
|
|
133
|
-
gsettings set org.gnome.desktop.interface icon-theme "$icon_theme"
|
|
134
|
-
|
|
135
|
-
# Apply cursor theme
|
|
136
|
-
log "Setting cursor theme to: $cursor_theme"
|
|
137
|
-
gsettings set org.gnome.desktop.interface cursor-theme "$cursor_theme"
|
|
138
|
-
|
|
139
|
-
# Apply color scheme (GNOME 42+)
|
|
140
|
-
if gsettings list-keys org.gnome.desktop.interface | grep -q "color-scheme"; then
|
|
141
|
-
log "Setting color scheme to: $color_scheme"
|
|
142
|
-
gsettings set org.gnome.desktop.interface color-scheme "$color_scheme"
|
|
143
|
-
fi
|
|
144
|
-
|
|
145
|
-
# Apply window manager theme
|
|
146
|
-
log "Setting window manager theme"
|
|
147
|
-
gsettings set org.gnome.desktop.wm.preferences theme "$gtk_theme"
|
|
148
|
-
|
|
149
|
-
# Apply shell theme (requires User Themes extension)
|
|
150
|
-
if [ -n "$shell_theme" ]; then
|
|
151
|
-
# Check if user-theme extension is enabled
|
|
152
|
-
if command -v gnome-extensions &>/dev/null; then
|
|
153
|
-
if gnome-extensions list --enabled | grep -q "user-theme"; then
|
|
154
|
-
log "Setting GNOME Shell theme to: $shell_theme"
|
|
155
|
-
gsettings set org.gnome.shell.extensions.user-theme name "$shell_theme"
|
|
156
|
-
else
|
|
157
|
-
warn "User Themes extension is not enabled. Shell theme not applied."
|
|
158
|
-
warn "Enable it with: gnome-extensions enable user-theme@gnome-shell-extensions.gcampax.github.com"
|
|
159
|
-
fi
|
|
160
|
-
else
|
|
161
|
-
# Fallback: try to set it anyway
|
|
162
|
-
log "Setting GNOME Shell theme to: $shell_theme"
|
|
163
|
-
gsettings set org.gnome.shell.extensions.user-theme name "$shell_theme" 2>/dev/null ||
|
|
164
|
-
warn "Could not set shell theme. User Themes extension may not be installed."
|
|
165
|
-
fi
|
|
166
|
-
fi
|
|
167
|
-
|
|
168
|
-
# Apply font settings
|
|
169
|
-
log "Setting font preferences"
|
|
170
|
-
gsettings set org.gnome.desktop.interface font-name 'Inter 10'
|
|
171
|
-
gsettings set org.gnome.desktop.interface document-font-name 'Inter 10'
|
|
172
|
-
gsettings set org.gnome.desktop.interface monospace-font-name 'JetBrains Mono 10'
|
|
173
|
-
gsettings set org.gnome.desktop.wm.preferences titlebar-font 'Inter Bold 10'
|
|
174
|
-
|
|
175
|
-
# Apply cursor size
|
|
176
|
-
gsettings set org.gnome.desktop.interface cursor-size 24
|
|
177
|
-
|
|
178
|
-
# Apply other interface settings
|
|
179
|
-
gsettings set org.gnome.desktop.interface enable-animations true
|
|
180
|
-
gsettings set org.gnome.desktop.interface enable-hot-corners true
|
|
181
|
-
gsettings set org.gnome.desktop.interface text-scaling-factor 1.0
|
|
182
|
-
|
|
183
|
-
# Apply window manager preferences
|
|
184
|
-
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'
|
|
185
|
-
gsettings set org.gnome.mutter dynamic-workspaces true
|
|
186
|
-
gsettings set org.gnome.mutter edge-tiling true
|
|
187
|
-
|
|
188
|
-
# Apply wallpaper if available
|
|
189
|
-
apply_wallpaper "$theme"
|
|
190
|
-
|
|
191
|
-
success "GNOME theme '$theme' applied successfully!"
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
# Function to apply wallpaper
|
|
195
|
-
apply_wallpaper() {
|
|
196
|
-
local theme="$1"
|
|
197
|
-
local wallpaper_dir="${DOTFILES_WALLPAPER_DIR:-$HOME/Pictures/Wallpapers}"
|
|
198
|
-
local mode="light"
|
|
199
|
-
|
|
200
|
-
# Determine light/dark from theme name
|
|
201
|
-
case "$theme" in
|
|
202
|
-
*-latte) mode="light" ;;
|
|
203
|
-
*-frappe | *-macchiato | *-mocha) mode="dark" ;;
|
|
204
|
-
*-light*) mode="light" ;;
|
|
205
|
-
*-dark* | *-night* | *-storm* | *-moon*) mode="dark" ;;
|
|
206
|
-
esac
|
|
207
|
-
|
|
208
|
-
# Pick a random wallpaper matching the mode from curated collection
|
|
209
|
-
local wp=""
|
|
210
|
-
if [ -d "$wallpaper_dir" ]; then
|
|
211
|
-
if command -v shuf >/dev/null 2>&1; then
|
|
212
|
-
wp="$(find "$wallpaper_dir" -maxdepth 1 -type f -iname "*-${mode}.jpg" 2>/dev/null | shuf -n 1 || true)"
|
|
213
|
-
else
|
|
214
|
-
wp="$(find "$wallpaper_dir" -maxdepth 1 -type f -iname "*-${mode}.jpg" 2>/dev/null | sort | head -n 1 || true)"
|
|
215
|
-
fi
|
|
216
|
-
fi
|
|
217
|
-
|
|
218
|
-
# Fallback: check Catppuccin system/user wallpapers
|
|
219
|
-
if [ -z "$wp" ]; then
|
|
220
|
-
local cat_flavor=""
|
|
221
|
-
case "$theme" in
|
|
222
|
-
catppuccin-latte) cat_flavor="latte" ;;
|
|
223
|
-
catppuccin-frappe) cat_flavor="frappe" ;;
|
|
224
|
-
catppuccin-macchiato) cat_flavor="macchiato" ;;
|
|
225
|
-
catppuccin-mocha) cat_flavor="mocha" ;;
|
|
226
|
-
esac
|
|
227
|
-
if [ -n "$cat_flavor" ]; then
|
|
228
|
-
for dir in /usr/share/backgrounds/catppuccin "$HOME/.local/share/backgrounds/catppuccin"; do
|
|
229
|
-
if [ -f "$dir/cat_${cat_flavor}.png" ]; then
|
|
230
|
-
wp="$dir/cat_${cat_flavor}.png"
|
|
231
|
-
break
|
|
232
|
-
fi
|
|
233
|
-
done
|
|
234
|
-
fi
|
|
235
|
-
fi
|
|
236
|
-
|
|
237
|
-
if [ -z "$wp" ]; then
|
|
238
|
-
warn "No ${mode} wallpapers found in $wallpaper_dir"
|
|
239
|
-
return
|
|
240
|
-
fi
|
|
241
|
-
|
|
242
|
-
log "Setting wallpaper: $wp"
|
|
243
|
-
|
|
244
|
-
# Set both light and dark URIs if we have a pair
|
|
245
|
-
local base="${wp%-${mode}.jpg}"
|
|
246
|
-
local light_wp="${base}-light.jpg"
|
|
247
|
-
local dark_wp="${base}-dark.jpg"
|
|
248
|
-
|
|
249
|
-
if [ -f "$light_wp" ] && [ -f "$dark_wp" ]; then
|
|
250
|
-
gsettings set org.gnome.desktop.background picture-uri "file://${light_wp}"
|
|
251
|
-
gsettings set org.gnome.desktop.background picture-uri-dark "file://${dark_wp}"
|
|
252
|
-
gsettings set org.gnome.desktop.screensaver picture-uri "file://${light_wp}"
|
|
253
|
-
else
|
|
254
|
-
gsettings set org.gnome.desktop.background picture-uri "file://$wp"
|
|
255
|
-
gsettings set org.gnome.desktop.background picture-uri-dark "file://$wp"
|
|
256
|
-
gsettings set org.gnome.desktop.screensaver picture-uri "file://$wp"
|
|
257
|
-
fi
|
|
258
|
-
gsettings set org.gnome.desktop.background picture-options "zoom"
|
|
259
|
-
|
|
260
|
-
success "Wallpaper set (${mode}): $(basename "$wp")"
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
# Function to backup current settings
|
|
264
|
-
backup_settings() {
|
|
265
|
-
local backup_file
|
|
266
|
-
backup_file="$HOME/.config/gnome-theme-backup-$(date +%Y%m%d-%H%M%S).dconf"
|
|
267
|
-
|
|
268
|
-
log "Backing up current GNOME settings to: $backup_file"
|
|
269
|
-
|
|
270
|
-
dconf dump /org/gnome/desktop/interface/ >"$backup_file.interface" 2>/dev/null || true
|
|
271
|
-
dconf dump /org/gnome/desktop/wm/preferences/ >"$backup_file.wm" 2>/dev/null || true
|
|
272
|
-
dconf dump /org/gnome/shell/extensions/user-theme/ >"$backup_file.shell" 2>/dev/null || true
|
|
273
|
-
|
|
274
|
-
if [ -f "$backup_file.interface" ]; then
|
|
275
|
-
success "Settings backed up successfully"
|
|
276
|
-
else
|
|
277
|
-
warn "Could not create backup. Continuing without backup."
|
|
278
|
-
fi
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
# Function to show current theme
|
|
282
|
-
show_current_theme() {
|
|
283
|
-
echo "Current GNOME theme settings:"
|
|
284
|
-
echo " GTK Theme: $(gsettings get org.gnome.desktop.interface gtk-theme)"
|
|
285
|
-
echo " Icon Theme: $(gsettings get org.gnome.desktop.interface icon-theme)"
|
|
286
|
-
echo " Cursor Theme: $(gsettings get org.gnome.desktop.interface cursor-theme)"
|
|
287
|
-
echo " Shell Theme: $(gsettings get org.gnome.shell.extensions.user-theme name 2>/dev/null || echo "'Not set or extension not available'")"
|
|
288
|
-
if gsettings list-keys org.gnome.desktop.interface | grep -q "color-scheme"; then
|
|
289
|
-
echo " Color Scheme: $(gsettings get org.gnome.desktop.interface color-scheme)"
|
|
290
|
-
fi
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
# Main execution
|
|
294
|
-
main() {
|
|
295
|
-
check_gsettings
|
|
296
|
-
|
|
297
|
-
case "$THEME_NAME" in
|
|
298
|
-
current)
|
|
299
|
-
show_current_theme
|
|
300
|
-
;;
|
|
301
|
-
backup)
|
|
302
|
-
backup_settings
|
|
303
|
-
;;
|
|
304
|
-
*)
|
|
305
|
-
# Check if theme files exist
|
|
306
|
-
theme_exists=false
|
|
307
|
-
|
|
308
|
-
case "$THEME_NAME" in
|
|
309
|
-
catppuccin-*)
|
|
310
|
-
for _d in "$HOME/.themes/Catppuccin-"*; do
|
|
311
|
-
if [ -d "$_d" ]; then
|
|
312
|
-
theme_exists=true
|
|
313
|
-
break
|
|
314
|
-
fi
|
|
315
|
-
done
|
|
316
|
-
;;
|
|
317
|
-
*)
|
|
318
|
-
theme_exists=true # Assume Adwaita and other system themes exist
|
|
319
|
-
;;
|
|
320
|
-
esac
|
|
321
|
-
|
|
322
|
-
if [ "$theme_exists" = "false" ]; then
|
|
323
|
-
warn "Catppuccin themes not found. Installing them first..."
|
|
324
|
-
"$HOME/.dotfiles/scripts/theme/install-catppuccin-themes.sh"
|
|
325
|
-
fi
|
|
326
|
-
|
|
327
|
-
backup_settings
|
|
328
|
-
apply_catppuccin_theme "$THEME_NAME"
|
|
329
|
-
;;
|
|
330
|
-
esac
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
main
|