@sebastienrousseau/dotfiles 0.2.481 → 0.2.499
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/docs/ARCHITECTURE.md +29 -196
- package/docs/COMPLIANCE.md +10 -10
- package/docs/COPYRIGHT +3 -4
- package/docs/OPERATIONS.md +38 -65
- package/docs/PLAN.md +3 -3
- package/docs/PR_DESCRIPTION.md +85 -84
- package/docs/ROADMAP.md +11 -11
- package/docs/ROADMAP_legacy.md +556 -0
- package/docs/SECURITY_CHECKLIST.md +1 -1
- package/docs/TASK.md +4 -4
- package/docs/WALKTHROUGH.md +33 -152
- package/package.json +17 -5
- package/scripts/backup.sh +142 -0
- package/scripts/banner.sh +20 -0
- package/scripts/benchmark.sh +20 -0
- package/scripts/build.sh +41 -0
- package/scripts/clean.sh +31 -0
- package/scripts/compile.sh +54 -0
- package/scripts/copy.sh +108 -0
- package/scripts/{tools/detect-collisions.py → detect-collisions.py} +1 -1
- package/scripts/doctor.sh +79 -0
- package/scripts/dotfiles.sh +63 -0
- package/scripts/download.sh +35 -0
- package/scripts/help.sh +57 -0
- package/scripts/lock-configs.sh +57 -0
- package/scripts/package.sh +46 -0
- package/scripts/ssh.sh +55 -0
- package/scripts/teleport.sh +23 -0
- package/scripts/{tests/test-aliases.sh → test-aliases.sh} +3 -3
- package/scripts/test_smoke.sh +88 -0
- package/scripts/unpack.sh +28 -0
- package/scripts/{diagnostics/verify_state.sh → verify_state.sh} +21 -21
- package/templates/projects/go/README.md +0 -4
- package/templates/projects/node/README.md +0 -4
- package/templates/projects/python/README.md +0 -4
- package/templates/projects/python/pyproject.toml +0 -15
- package/CHANGELOG.md +0 -285
- package/LICENSE +0 -1283
- package/README.md +0 -315
- package/docs/ALIASES.md +0 -128
- package/docs/FEATURES.md +0 -166
- package/docs/FONTS.md +0 -147
- package/docs/INSTALL.md +0 -119
- package/docs/KEYS.md +0 -40
- package/docs/KEY_ROTATION.md +0 -219
- package/docs/LEGACY_ROADMAP.md +0 -142
- package/docs/NEOVIM_IDE_GUIDE.md +0 -52
- package/docs/README.md +0 -269
- package/docs/REPO_AUDIT.md +0 -23
- package/docs/SCREENSHOTS.md +0 -116
- package/docs/SECRETS.md +0 -76
- package/docs/SECURITY.md +0 -30
- package/docs/TESTING.md +0 -190
- package/docs/TOOLS.md +0 -146
- package/docs/TROUBLESHOOTING.md +0 -112
- package/docs/UTILS.md +0 -105
- package/docs/WSL2_NIX_TROUBLESHOOTING.md +0 -723
- package/docs/adr/ADR-001-ci-cd-pipeline.md +0 -101
- package/docs/adr/ADR-002-shell-performance.md +0 -121
- package/docs/adr/ADR-003-security-first.md +0 -140
- package/docs/adr/ADR-004-cli-architecture.md +0 -157
- package/docs/adr/ADR-005-chezmoi-choice.md +0 -89
- package/docs/adr/ADR-006-shell-selection.md +0 -115
- package/docs/adr/README.md +0 -33
- package/docs/themes/README.md +0 -20
- package/dot_config/aider/aider.conf.yml +0 -32
- package/dot_config/alacritty/alacritty.toml.tmpl +0 -483
- package/dot_config/ansible/ansible.cfg.tmpl +0 -11
- package/dot_config/atuin/config.toml +0 -23
- package/dot_config/bat/config +0 -8
- 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 -49
- package/dot_config/clippy.toml +0 -55
- 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.tmpl +0 -15
- package/dot_config/dotfiles/boot/README.md +0 -11
- package/dot_config/dotfiles/grub/README.md +0 -11
- package/dot_config/dotfiles/lock/README.md +0 -11
- package/dot_config/dotfiles/versions.env.tmpl +0 -19
- 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/fastfetch/config.jsonc +0 -28
- package/dot_config/firefox/user.js +0 -8
- package/dot_config/flatpak/flatpak.list +0 -4
- package/dot_config/fontconfig/fonts.conf.tmpl +0 -44
- package/dot_config/gem/gemrc +0 -9
- package/dot_config/gh/config.yml +0 -12
- package/dot_config/ghostty/config.tmpl +0 -661
- package/dot_config/git/attributes +0 -12
- package/dot_config/git/config.tmpl +0 -77
- package/dot_config/git/ignore +0 -27
- package/dot_config/gnupg/gpg-agent.conf.tmpl +0 -11
- package/dot_config/go/aliases.sh +0 -61
- package/dot_config/go/env.sh +0 -24
- 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 -305
- package/dot_config/gtk-3.0/settings.ini.tmpl +0 -66
- package/dot_config/gtk-4.0/gtk.css.tmpl +0 -309
- package/dot_config/gtk-4.0/settings.ini.tmpl +0 -21
- package/dot_config/htop/htoprc +0 -20
- package/dot_config/ice/README.md +0 -13
- package/dot_config/inputrc +0 -2
- package/dot_config/ipython/profile_default/ipython_config.py.tmpl +0 -5
- package/dot_config/just/justfile +0 -104
- package/dot_config/k9s/config.yaml.tmpl +0 -65
- package/dot_config/k9s/skins/catppuccin-mocha.yaml +0 -116
- package/dot_config/karabiner/karabiner.json +0 -14
- package/dot_config/kitty/kitty.conf.tmpl +0 -517
- package/dot_config/lazydocker/config.yml +0 -186
- package/dot_config/lazygit/config.yml +0 -23
- package/dot_config/lsd/config.yaml +0 -19
- package/dot_config/mas/masapps.txt +0 -5
- package/dot_config/minikube/config.json +0 -13
- package/dot_config/mise/config.toml +0 -41
- package/dot_config/mongosh/mongoshrc.js +0 -67
- package/dot_config/mycli/myclirc +0 -67
- package/dot_config/nano/nanorc +0 -28
- package/dot_config/ncdu/config +0 -12
- package/dot_config/nvim/init.lua +0 -4
- package/dot_config/nvim/lazy-lock.json +0 -27
- package/dot_config/nvim/lua/config/autocmds.lua +0 -63
- package/dot_config/nvim/lua/config/keymaps.lua +0 -87
- package/dot_config/nvim/lua/config/lazy.lua +0 -34
- package/dot_config/nvim/lua/config/options.lua +0 -48
- package/dot_config/nvim/lua/plugins/coding.lua +0 -234
- package/dot_config/nvim/lua/plugins/dap.lua +0 -201
- package/dot_config/nvim/lua/plugins/editor.lua +0 -59
- package/dot_config/nvim/lua/plugins/git.lua +0 -9
- package/dot_config/nvim/lua/plugins/lsp.lua +0 -221
- package/dot_config/nvim/lua/plugins/markdown.lua +0 -17
- package/dot_config/nvim/lua/plugins/rust.lua +0 -33
- package/dot_config/nvim/lua/plugins/sessions.lua +0 -32
- package/dot_config/nvim/lua/plugins/ui.lua +0 -537
- package/dot_config/nvim/snippets/all.lua +0 -9
- package/dot_config/nvim/snippets/python.lua +0 -16
- package/dot_config/pip/pip.conf.tmpl +0 -32
- package/dot_config/pypoetry/config.toml.tmpl +0 -6
- package/dot_config/pyrightconfig.json.tmpl +0 -5
- package/dot_config/raycast/README.md +0 -13
- package/dot_config/redis/redisclirc +0 -41
- package/dot_config/shell/00-container-detect.sh +0 -53
- package/dot_config/shell/00-core-paths.sh.tmpl +0 -95
- package/dot_config/shell/05-core-safety.sh.tmpl +0 -13
- package/dot_config/shell/40-ls-colors.sh.tmpl +0 -31
- package/dot_config/shell/50-logic-functions.sh.tmpl +0 -10
- package/dot_config/shell/90-theme-switch.sh +0 -70
- package/dot_config/shell/90-ux-aliases.sh.tmpl +0 -35
- package/dot_config/shell/91-ux-aliases-lazy.sh.tmpl +0 -23
- package/dot_config/shell/Brewfile +0 -207
- package/dot_config/shell/Brewfile.cask +0 -92
- package/dot_config/shell/Brewfile.cli +0 -119
- package/dot_config/shell/README.md +0 -267
- 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 -124
- package/dot_config/task/Taskfile.yml +0 -86
- package/dot_config/tflint/tflint.hcl.tmpl +0 -9
- package/dot_config/tmux/tmux.conf.tmpl +0 -181
- package/dot_config/topgrade/topgrade.toml.tmpl +0 -42
- package/dot_config/vscode/extensions.txt +0 -11
- package/dot_config/vscode/settings.json.tmpl +0 -123
- package/dot_config/waybar/style.css +0 -8
- package/dot_config/wezterm/wezterm.lua.tmpl +0 -236
- package/dot_config/wget/wgetrc +0 -12
- package/dot_config/yarn/yarnrc.yml.tmpl +0 -36
- package/dot_config/yazi/yazi.toml +0 -40
- package/dot_config/zellij/config.kdl +0 -79
- package/dot_config/zsh/dot_zprofile +0 -13
- package/dot_config/zsh/dot_zshenv +0 -6
- package/dot_config/zsh/dot_zshrc.tmpl +0 -199
- package/dot_config/zsh/rc.d/05-ssh-agent.zsh +0 -5
- package/dot_config/zsh/rc.d/10-env.zsh.tmpl +0 -28
- package/dot_config/zsh/rc.d/20-zinit.zsh.tmpl +0 -22
- package/dot_config/zsh/rc.d/30-options.zsh.tmpl +0 -123
- package/dot_config/zsh/rc.d/40-bell.zsh.tmpl +0 -20
- package/dot_config/zsh/rc.d/50-login-fortune.zsh.tmpl +0 -9
- package/dot_local/bin/executable_ai_core +0 -130
- package/dot_local/bin/executable_b64 +0 -59
- package/dot_local/bin/executable_dot +0 -178
- package/dot_local/bin/executable_dot_completion +0 -55
- package/dot_local/bin/executable_epoch +0 -62
- package/dot_local/bin/executable_extract +0 -108
- package/dot_local/bin/executable_git-ai-commit +0 -160
- package/dot_local/bin/executable_git-ai-diff +0 -154
- package/dot_local/bin/executable_hash +0 -123
- package/dot_local/bin/executable_hex +0 -79
- package/dot_local/bin/executable_ip +0 -37
- package/dot_local/bin/executable_jsonv +0 -54
- package/dot_local/bin/executable_jwt +0 -78
- package/dot_local/bin/executable_kill-port +0 -59
- package/dot_local/bin/executable_lorem +0 -103
- package/dot_local/bin/executable_regex +0 -96
- package/dot_local/bin/executable_tmux-sessionizer +0 -187
- package/dot_local/bin/executable_tour +0 -137
- package/dot_local/bin/executable_update +0 -108
- package/dot_local/bin/executable_uuid +0 -57
- package/dot_local/bin/executable_yamlv +0 -39
- package/dot_local/bin/executable_zig-install +0 -89
- package/dot_local/bin/voice_ops +0 -7
- package/dot_local/share/bash-completion/completions/dot +0 -54
- package/dot_local/share/zsh/completions/.keep +0 -0
- package/install.sh +0 -255
- package/scripts/ci/validate-ci-config.sh +0 -222
- package/scripts/demo/record.sh +0 -41
- package/scripts/diagnostics/benchmark.sh +0 -201
- package/scripts/diagnostics/doctor.sh +0 -115
- package/scripts/diagnostics/drift-dashboard.sh +0 -26
- package/scripts/diagnostics/health.sh +0 -356
- package/scripts/diagnostics/history-analysis.sh +0 -77
- package/scripts/diagnostics/security-score.sh +0 -392
- package/scripts/dot/commands/appearance.sh +0 -63
- package/scripts/dot/commands/core.sh +0 -130
- package/scripts/dot/commands/diagnostics.sh +0 -100
- package/scripts/dot/commands/meta.sh +0 -117
- package/scripts/dot/commands/restore.sh +0 -209
- package/scripts/dot/commands/secrets.sh +0 -81
- package/scripts/dot/commands/security.sh +0 -73
- package/scripts/dot/commands/tools.sh +0 -228
- package/scripts/dot/lib/utils.sh +0 -72
- package/scripts/fonts/install-nerd-fonts.sh +0 -59
- package/scripts/fonts/patch-fonts.sh +0 -34
- package/scripts/ops/chezmoi-apply.sh +0 -42
- package/scripts/ops/chezmoi-diff.sh +0 -14
- package/scripts/ops/chezmoi-remove.sh +0 -43
- package/scripts/ops/chezmoi-update.sh +0 -16
- package/scripts/ops/heal.sh +0 -466
- package/scripts/ops/health-check.sh +0 -380
- package/scripts/ops/rollback.sh +0 -531
- package/scripts/ops/teleport.sh +0 -32
- package/scripts/secrets/age-init.sh +0 -69
- package/scripts/secrets/create-secrets-file.sh +0 -44
- package/scripts/secrets/encrypt-ssh-key.sh +0 -42
- package/scripts/security/backup.sh +0 -17
- package/scripts/security/dns-doh.sh +0 -29
- package/scripts/security/encryption-check.sh +0 -39
- package/scripts/security/enforce-policies.sh +0 -339
- package/scripts/security/firewall.sh +0 -34
- package/scripts/security/lock-configs.sh +0 -57
- package/scripts/security/lock-screen.sh +0 -33
- package/scripts/security/manage-secrets.sh +0 -415
- package/scripts/security/telemetry-kill.sh +0 -28
- package/scripts/security/usb-safety.sh +0 -29
- package/scripts/tests/README.md +0 -241
- package/scripts/tests/benchmark.sh +0 -91
- package/scripts/tests/framework/assertions.sh +0 -283
- package/scripts/tests/framework/mocks.sh +0 -201
- package/scripts/tests/framework/test_runner.sh +0 -189
- package/scripts/tests/integration/test_install.sh +0 -237
- package/scripts/tests/performance/benchmark_runner.sh +0 -156
- package/scripts/tests/performance/regression_check.sh +0 -73
- package/scripts/tests/performance/stress_test.sh +0 -65
- package/scripts/tests/test-docker.sh +0 -48
- package/scripts/tests/unit/test_ai_aliases.sh +0 -158
- package/scripts/tests/unit/test_ai_cli_checks.sh +0 -47
- package/scripts/tests/unit/test_backup.sh +0 -227
- package/scripts/tests/unit/test_case_functions.sh +0 -238
- package/scripts/tests/unit/test_cd_aliases.sh +0 -367
- package/scripts/tests/unit/test_dot_cli.sh +0 -217
- package/scripts/tests/unit/test_encode64.sh +0 -67
- package/scripts/tests/unit/test_environment.sh +0 -78
- package/scripts/tests/unit/test_extract.sh +0 -163
- package/scripts/tests/unit/test_framework_edge_cases.sh +0 -113
- package/scripts/tests/unit/test_genpass.sh +0 -298
- package/scripts/tests/unit/test_install_edge_cases.sh +0 -167
- package/scripts/tests/unit/test_installers.sh +0 -172
- package/scripts/tests/unit/test_keygen.sh +0 -68
- package/scripts/tests/unit/test_logging.sh +0 -96
- package/scripts/tests/unit/test_os_detection_comprehensive.sh +0 -388
- package/scripts/tests/unit/test_package_managers_comprehensive.sh +0 -321
- package/scripts/tests/unit/test_prependpath.sh +0 -66
- package/scripts/tests/unit/test_prependpath_refactored.sh +0 -89
- package/scripts/tests/unit/test_rd.sh +0 -230
- package/scripts/tests/unit/test_security_fixes.sh +0 -130
- package/scripts/tests/unit/test_security_scripts.sh +0 -87
- package/scripts/tests/unit/test_template_validation.sh +0 -238
- package/scripts/tests/unit/test_utility_functions.sh +0 -144
- package/scripts/tests/unit/test_wave1_alias_split.sh +0 -132
- package/scripts/tests/unit/test_wave1_ci_pinning.sh +0 -61
- package/scripts/tests/unit/test_wave1_gitleaks_config.sh +0 -52
- package/scripts/tests/unit/test_wave1_heal_fixes.sh +0 -97
- package/scripts/tests/unit/test_wave1_install_gpg.sh +0 -35
- package/scripts/tests/unit/test_wave1_zshenv_path.sh +0 -89
- package/scripts/tests/unit/test_wave1_zshrc_lazy_hook.sh +0 -115
- package/scripts/tests/unit/test_wave2_dot_new_guard.sh +0 -75
- package/scripts/tests/unit/test_zipf.sh +0 -76
- package/scripts/theme/apply-gnome-theme.sh +0 -297
- package/scripts/theme/install-boot-logo.sh +0 -61
- package/scripts/theme/install-catppuccin-themes.sh +0 -346
- package/scripts/theme/install-cursors.sh +0 -24
- package/scripts/theme/install-file-icons.sh +0 -25
- package/scripts/theme/install-grub-theme.sh +0 -51
- package/scripts/theme/install-lock-icon.sh +0 -29
- package/scripts/theme/switch.sh +0 -250
- package/scripts/theme/wallpaper-rotate.sh +0 -82
- package/scripts/theme/wallpaper-sync.sh +0 -42
- package/scripts/tools/cmatrix.sh +0 -20
- package/scripts/tools/emoji-picker.sh +0 -45
- package/scripts/tools/figlet-banner.sh +0 -17
- package/scripts/tools/log-rotate.sh +0 -29
- package/scripts/tools/lolcat-wrap.sh +0 -18
- package/scripts/tools/pipes.sh +0 -47
- package/scripts/tuning/linux.sh +0 -175
- package/scripts/tuning/macos.sh +0 -46
- 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/packer/README.md +0 -15
- package/templates/projects/packer/main.pkr.hcl +0 -15
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# shellcheck disable=SC1090,SC1091,SC2034,SC2016
|
|
3
|
-
# Unit tests for Wave 1: zshrc lazy alias loading hook and FNM fix
|
|
4
|
-
set -euo pipefail
|
|
5
|
-
|
|
6
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
-
REPO_ROOT="${REPO_ROOT:-$(cd "$SCRIPT_DIR/../../.." && pwd)}"
|
|
8
|
-
source "$SCRIPT_DIR/../framework/assertions.sh"
|
|
9
|
-
|
|
10
|
-
ZSHRC="$REPO_ROOT/dot_config/zsh/dot_zshrc.tmpl"
|
|
11
|
-
OPTIONS="$REPO_ROOT/dot_config/zsh/rc.d/30-options.zsh.tmpl"
|
|
12
|
-
|
|
13
|
-
echo "Testing Wave 1: zshrc lazy hook and FNM fix..."
|
|
14
|
-
|
|
15
|
-
# --- zshrc lazy loading ---
|
|
16
|
-
|
|
17
|
-
test_start "zshrc_exists"
|
|
18
|
-
assert_file_exists "$ZSHRC" "dot_zshrc.tmpl should exist"
|
|
19
|
-
|
|
20
|
-
test_start "zshrc_loads_eager_aliases"
|
|
21
|
-
assert_file_contains "$ZSHRC" "90-ux-aliases" "should source 90-ux-aliases in core loop"
|
|
22
|
-
|
|
23
|
-
test_start "zshrc_loads_lazy_aliases"
|
|
24
|
-
assert_file_contains "$ZSHRC" "91-ux-aliases-lazy" "should reference 91-ux-aliases-lazy"
|
|
25
|
-
|
|
26
|
-
test_start "zshrc_uses_precmd_hook"
|
|
27
|
-
assert_file_contains "$ZSHRC" "add-zsh-hook precmd _load_deferred_layers" "should register precmd hook for deferred layers"
|
|
28
|
-
|
|
29
|
-
test_start "zshrc_removes_hook_after_load"
|
|
30
|
-
assert_file_contains "$ZSHRC" "add-zsh-hook -d precmd _load_deferred_layers" "should deregister hook after loading"
|
|
31
|
-
|
|
32
|
-
test_start "zshrc_autoloads_add_zsh_hook"
|
|
33
|
-
assert_file_contains "$ZSHRC" "autoload -Uz add-zsh-hook" "should autoload add-zsh-hook"
|
|
34
|
-
|
|
35
|
-
test_start "zshrc_no_eager_fnm_eval"
|
|
36
|
-
# There should be no eager `eval "$(fnm env` in the zshrc outside of 30-options
|
|
37
|
-
if grep -q 'eval "$(fnm env' "$ZSHRC" 2>/dev/null; then
|
|
38
|
-
((TESTS_FAILED++))
|
|
39
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: zshrc should not eagerly eval fnm env"
|
|
40
|
-
else
|
|
41
|
-
((TESTS_PASSED++))
|
|
42
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: no eager fnm eval in zshrc"
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
|
-
test_start "zshrc_core_loop_layers"
|
|
46
|
-
# Verify the core loading loop includes the expected eager layers
|
|
47
|
-
# (50-logic-functions is now deferred via precmd hook)
|
|
48
|
-
all_layers_found=true
|
|
49
|
-
for layer in "00-core-paths" "05-core-safety" "40-ls-colors" "90-ux-aliases"; do
|
|
50
|
-
if ! grep -q "$layer" "$ZSHRC"; then
|
|
51
|
-
all_layers_found=false
|
|
52
|
-
((TESTS_FAILED++)) || true
|
|
53
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: missing layer $layer in core loop"
|
|
54
|
-
break
|
|
55
|
-
fi
|
|
56
|
-
done
|
|
57
|
-
if [[ "$all_layers_found" == "true" ]]; then
|
|
58
|
-
((TESTS_PASSED++)) || true
|
|
59
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: all 4 eager core layers present in loading loop"
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
test_start "zshrc_deferred_logic_functions"
|
|
63
|
-
assert_file_contains "$ZSHRC" "50-logic-functions" "50-logic-functions should be loaded via deferred hook"
|
|
64
|
-
|
|
65
|
-
test_start "zshrc_interactive_guard"
|
|
66
|
-
assert_file_contains "$ZSHRC" "[[ -o interactive ]] || return" "should skip non-interactive shells"
|
|
67
|
-
|
|
68
|
-
test_start "zshrc_source_guard"
|
|
69
|
-
assert_file_contains "$ZSHRC" "DOTFILES_SOURCED" "should guard against double-sourcing"
|
|
70
|
-
|
|
71
|
-
# --- 30-options.zsh FNM fix ---
|
|
72
|
-
|
|
73
|
-
test_start "options_exists"
|
|
74
|
-
assert_file_exists "$OPTIONS" "30-options.zsh.tmpl should exist"
|
|
75
|
-
|
|
76
|
-
test_start "options_fnm_lazy_load"
|
|
77
|
-
assert_file_contains "$OPTIONS" "_lazy_load_fnm" "should define _lazy_load_fnm function"
|
|
78
|
-
|
|
79
|
-
test_start "options_fnm_lazy_wrapper"
|
|
80
|
-
# fnm should be wrapped as lazy-load function
|
|
81
|
-
if grep -q 'fnm() { _lazy_load_fnm; command fnm' "$OPTIONS"; then
|
|
82
|
-
((TESTS_PASSED++))
|
|
83
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: fnm has lazy-load wrapper"
|
|
84
|
-
else
|
|
85
|
-
((TESTS_FAILED++))
|
|
86
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: fnm should have lazy-load wrapper"
|
|
87
|
-
fi
|
|
88
|
-
|
|
89
|
-
test_start "options_node_lazy_wrapper"
|
|
90
|
-
assert_file_contains "$OPTIONS" 'node() { _lazy_load_fnm' "node should trigger fnm lazy load"
|
|
91
|
-
|
|
92
|
-
test_start "options_no_duplicate_fnm_lazy"
|
|
93
|
-
# Count how many _lazy_load_fnm function definitions exist (should be exactly 1)
|
|
94
|
-
fnm_defs=$(grep -c '_lazy_load_fnm()' "$OPTIONS" || true)
|
|
95
|
-
if [[ "$fnm_defs" -eq 1 ]]; then
|
|
96
|
-
((TESTS_PASSED++))
|
|
97
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: exactly one _lazy_load_fnm definition"
|
|
98
|
-
else
|
|
99
|
-
((TESTS_FAILED++))
|
|
100
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: expected 1 _lazy_load_fnm definition, found $fnm_defs"
|
|
101
|
-
fi
|
|
102
|
-
|
|
103
|
-
test_start "options_nvm_fallback"
|
|
104
|
-
assert_file_contains "$OPTIONS" '_lazy_load_nvm' "should have NVM fallback when fnm unavailable"
|
|
105
|
-
|
|
106
|
-
test_start "options_nvm_requires_no_fnm"
|
|
107
|
-
# NVM should only load if fnm is NOT available
|
|
108
|
-
assert_file_contains "$OPTIONS" '! command -v fnm' "NVM block should be guarded by fnm absence"
|
|
109
|
-
|
|
110
|
-
test_start "options_sdkman_lazy"
|
|
111
|
-
assert_file_contains "$OPTIONS" '_lazy_load_sdkman' "should have SDKMAN lazy loader"
|
|
112
|
-
|
|
113
|
-
echo ""
|
|
114
|
-
echo "Wave 1 zshrc lazy hook and FNM fix tests completed."
|
|
115
|
-
print_summary
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# shellcheck disable=SC1090,SC1091,SC2034
|
|
3
|
-
# Unit tests for Wave 2: dot new Python pre-flight guard
|
|
4
|
-
set -euo pipefail
|
|
5
|
-
|
|
6
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
-
REPO_ROOT="${REPO_ROOT:-$(cd "$SCRIPT_DIR/../../.." && pwd)}"
|
|
8
|
-
source "$SCRIPT_DIR/../framework/assertions.sh"
|
|
9
|
-
|
|
10
|
-
DOT_CLI="$REPO_ROOT/dot_local/bin/executable_dot"
|
|
11
|
-
|
|
12
|
-
echo "Testing Wave 2: dot new Python pre-flight guard..."
|
|
13
|
-
|
|
14
|
-
test_start "dot_cli_exists"
|
|
15
|
-
assert_file_exists "$DOT_CLI" "executable_dot should exist"
|
|
16
|
-
|
|
17
|
-
test_start "dot_cli_syntax"
|
|
18
|
-
assert_exit_code 0 "bash -n '$DOT_CLI'"
|
|
19
|
-
|
|
20
|
-
# The Python check lives in the tools.sh command module (dispatched from executable_dot)
|
|
21
|
-
TOOLS_MODULE="$REPO_ROOT/scripts/dot/commands/tools.sh"
|
|
22
|
-
|
|
23
|
-
test_start "python_check_before_filesystem_ops"
|
|
24
|
-
# Extract the cmd_new function and verify python check comes before mkdir
|
|
25
|
-
if [[ -f "$TOOLS_MODULE" ]]; then
|
|
26
|
-
new_block=$(sed -n '/cmd_new()/,/^}/p' "$TOOLS_MODULE")
|
|
27
|
-
python_line=$(echo "$new_block" | grep -n 'python3\|PYTHON_CMD' | head -1 | cut -d: -f1)
|
|
28
|
-
mkdir_line=$(echo "$new_block" | grep -n 'mkdir' | head -1 | cut -d: -f1)
|
|
29
|
-
|
|
30
|
-
if [[ -n "$python_line" && -n "$mkdir_line" ]]; then
|
|
31
|
-
if [[ "$python_line" -lt "$mkdir_line" ]]; then
|
|
32
|
-
((TESTS_PASSED++)) || true
|
|
33
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: Python check (line $python_line) before mkdir (line $mkdir_line)"
|
|
34
|
-
else
|
|
35
|
-
((TESTS_FAILED++)) || true
|
|
36
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: Python check should come before mkdir"
|
|
37
|
-
fi
|
|
38
|
-
elif [[ -n "$python_line" ]]; then
|
|
39
|
-
((TESTS_PASSED++)) || true
|
|
40
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: Python check present in new block"
|
|
41
|
-
else
|
|
42
|
-
((TESTS_FAILED++)) || true
|
|
43
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: Python check not found in new block"
|
|
44
|
-
fi
|
|
45
|
-
else
|
|
46
|
-
((TESTS_FAILED++)) || true
|
|
47
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: tools.sh module not found"
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
test_start "python_error_to_stderr"
|
|
51
|
-
# The error message should go to stderr (in tools.sh module)
|
|
52
|
-
if [[ -f "$TOOLS_MODULE" ]] && grep -q 'python3.*required' "$TOOLS_MODULE"; then
|
|
53
|
-
((TESTS_PASSED++)) || true
|
|
54
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: Python requirement check present in tools module"
|
|
55
|
-
else
|
|
56
|
-
((TESTS_FAILED++)) || true
|
|
57
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: Python error should be checked in tools module"
|
|
58
|
-
fi
|
|
59
|
-
|
|
60
|
-
test_start "dot_new_no_args_usage"
|
|
61
|
-
set +e
|
|
62
|
-
output=$(CHEZMOI_SOURCE_DIR="$REPO_ROOT" bash "$DOT_CLI" new 2>&1)
|
|
63
|
-
ec=$?
|
|
64
|
-
set -e
|
|
65
|
-
if [[ "$output" == *"Usage:"* ]] && [[ $ec -ne 0 ]]; then
|
|
66
|
-
((TESTS_PASSED++)) || true
|
|
67
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: dot new with no args shows usage"
|
|
68
|
-
else
|
|
69
|
-
((TESTS_FAILED++)) || true
|
|
70
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: dot new with no args should show usage (ec=$ec)"
|
|
71
|
-
fi
|
|
72
|
-
|
|
73
|
-
echo ""
|
|
74
|
-
echo "Wave 2 dot new Python guard tests completed."
|
|
75
|
-
print_summary
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# shellcheck disable=SC1090,SC1091,SC2034
|
|
3
|
-
# Unit tests for zipf function
|
|
4
|
-
|
|
5
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
-
REPO_ROOT="${REPO_ROOT:-$(cd "$SCRIPT_DIR/../../.." && pwd)}"
|
|
7
|
-
source "$SCRIPT_DIR/../framework/assertions.sh"
|
|
8
|
-
|
|
9
|
-
# Source the function
|
|
10
|
-
FUNC_FILE="$REPO_ROOT/.chezmoitemplates/functions/zipf.sh"
|
|
11
|
-
if [[ -f "$FUNC_FILE" ]]; then
|
|
12
|
-
source "$FUNC_FILE"
|
|
13
|
-
else
|
|
14
|
-
echo "SKIP: zipf.sh not found at $FUNC_FILE"
|
|
15
|
-
echo "RESULTS:0:0:0"
|
|
16
|
-
exit 0
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
echo "Testing zipf function..."
|
|
20
|
-
|
|
21
|
-
# Test function exists
|
|
22
|
-
test_start "zipf_function_exists"
|
|
23
|
-
assert_true "type zipf &>/dev/null" "zipf function should exist"
|
|
24
|
-
|
|
25
|
-
# Test no arguments
|
|
26
|
-
test_start "zipf_no_args"
|
|
27
|
-
if type zipf &>/dev/null; then
|
|
28
|
-
assert_exit_code 1 "zipf 2>/dev/null"
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
# Test nonexistent directory
|
|
32
|
-
test_start "zipf_nonexistent_dir"
|
|
33
|
-
if type zipf &>/dev/null; then
|
|
34
|
-
# zipf returns non-zero for nonexistent paths (exit code varies by implementation)
|
|
35
|
-
result=$(
|
|
36
|
-
zipf /nonexistent/path/12345 2>/dev/null
|
|
37
|
-
echo $?
|
|
38
|
-
)
|
|
39
|
-
if [[ "$result" != "0" ]]; then
|
|
40
|
-
((TESTS_PASSED++)) || true
|
|
41
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: returns non-zero for nonexistent path"
|
|
42
|
-
else
|
|
43
|
-
((TESTS_FAILED++)) || true
|
|
44
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: should fail for nonexistent path"
|
|
45
|
-
fi
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
# Test with valid directory
|
|
49
|
-
test_start "zipf_valid_directory"
|
|
50
|
-
if type zipf &>/dev/null; then
|
|
51
|
-
test_dir=$(mktemp -d)
|
|
52
|
-
echo "test" >"$test_dir/test.txt"
|
|
53
|
-
|
|
54
|
-
# Run zipf and check if zip was created
|
|
55
|
-
zipf "$test_dir" 2>/dev/null || true
|
|
56
|
-
|
|
57
|
-
if [[ -f "${test_dir}.zip" ]]; then
|
|
58
|
-
((TESTS_PASSED++)) || true
|
|
59
|
-
echo -e " ${GREEN}✓${NC} $CURRENT_TEST: zipf created archive"
|
|
60
|
-
else
|
|
61
|
-
((TESTS_FAILED++)) || true
|
|
62
|
-
echo -e " ${RED}✗${NC} $CURRENT_TEST: zipf should create a .zip archive"
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
# Cleanup
|
|
66
|
-
rm -rf "$test_dir" "${test_dir}.zip" 2>/dev/null
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
# Test help flag if supported
|
|
70
|
-
test_start "zipf_help_flag"
|
|
71
|
-
if type zipf &>/dev/null; then
|
|
72
|
-
output=$(zipf --help 2>&1 || zipf -h 2>&1 || echo "no help")
|
|
73
|
-
assert_not_empty "$output" "help flag should produce output"
|
|
74
|
-
fi
|
|
75
|
-
|
|
76
|
-
print_summary
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# GNOME Theme Applicator - Applies Catppuccin themes to GNOME desktop
|
|
3
|
-
# Usage: apply-gnome-theme.sh <theme-name>
|
|
4
|
-
|
|
5
|
-
set -e
|
|
6
|
-
|
|
7
|
-
THEME_NAME="$1"
|
|
8
|
-
|
|
9
|
-
if [ -z "$THEME_NAME" ]; then
|
|
10
|
-
echo "Usage: $0 <theme-name>"
|
|
11
|
-
echo "Available themes: catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha"
|
|
12
|
-
exit 1
|
|
13
|
-
fi
|
|
14
|
-
|
|
15
|
-
# Colors for output
|
|
16
|
-
RED='\033[0;31m'
|
|
17
|
-
GREEN='\033[0;32m'
|
|
18
|
-
YELLOW='\033[1;33m'
|
|
19
|
-
BLUE='\033[0;34m'
|
|
20
|
-
NC='\033[0m'
|
|
21
|
-
|
|
22
|
-
log() {
|
|
23
|
-
echo -e "${BLUE}[GNOME]${NC} $1"
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
warn() {
|
|
27
|
-
echo -e "${YELLOW}[WARN]${NC} $1"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
error() {
|
|
31
|
-
echo -e "${RED}[ERROR]${NC} $1"
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
success() {
|
|
35
|
-
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
# Check if we're running GNOME
|
|
39
|
-
if [ "$XDG_CURRENT_DESKTOP" != "GNOME" ] && [ "$XDG_SESSION_DESKTOP" != "gnome" ]; then
|
|
40
|
-
warn "Not running GNOME desktop. Some settings may not apply."
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
# Function to check if gsettings is available
|
|
44
|
-
check_gsettings() {
|
|
45
|
-
if ! command -v gsettings &>/dev/null; then
|
|
46
|
-
error "gsettings command not found. Please install GLib development tools."
|
|
47
|
-
exit 1
|
|
48
|
-
fi
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
# Function to apply Catppuccin theme settings
|
|
52
|
-
apply_catppuccin_theme() {
|
|
53
|
-
local theme="$1"
|
|
54
|
-
local gtk_theme=""
|
|
55
|
-
local shell_theme=""
|
|
56
|
-
local icon_theme=""
|
|
57
|
-
local cursor_theme="Adwaita"
|
|
58
|
-
local color_scheme="prefer-light"
|
|
59
|
-
|
|
60
|
-
case "$theme" in
|
|
61
|
-
catppuccin-latte)
|
|
62
|
-
gtk_theme="Catppuccin-Latte-Standard-Blue-Light"
|
|
63
|
-
shell_theme="Catppuccin-Latte"
|
|
64
|
-
icon_theme="Papirus-Light"
|
|
65
|
-
cursor_theme="Catppuccin-Latte-Blue"
|
|
66
|
-
color_scheme="prefer-light"
|
|
67
|
-
;;
|
|
68
|
-
catppuccin-frappe)
|
|
69
|
-
gtk_theme="Catppuccin-Frappe-Standard-Blue-Dark"
|
|
70
|
-
shell_theme="Catppuccin-Frappe"
|
|
71
|
-
icon_theme="Papirus-Dark"
|
|
72
|
-
cursor_theme="Catppuccin-Frappe-Blue"
|
|
73
|
-
color_scheme="prefer-dark"
|
|
74
|
-
;;
|
|
75
|
-
catppuccin-macchiato)
|
|
76
|
-
gtk_theme="Catppuccin-Macchiato-Standard-Blue-Dark"
|
|
77
|
-
shell_theme="Catppuccin-Macchiato"
|
|
78
|
-
icon_theme="Papirus-Dark"
|
|
79
|
-
cursor_theme="Catppuccin-Macchiato-Blue"
|
|
80
|
-
color_scheme="prefer-dark"
|
|
81
|
-
;;
|
|
82
|
-
catppuccin-mocha)
|
|
83
|
-
gtk_theme="Catppuccin-Mocha-Standard-Blue-Dark"
|
|
84
|
-
shell_theme="Catppuccin-Mocha"
|
|
85
|
-
icon_theme="Papirus-Dark"
|
|
86
|
-
cursor_theme="Catppuccin-Mocha-Blue"
|
|
87
|
-
color_scheme="prefer-dark"
|
|
88
|
-
;;
|
|
89
|
-
*)
|
|
90
|
-
# Non-Catppuccin themes - use fallback
|
|
91
|
-
if [[ "$theme" == *"-dark"* ]] || [[ "$theme" == *"-night"* ]] || [[ "$theme" == *"-storm"* ]] || [[ "$theme" == *"-moon"* ]] || [[ "$theme" == *"-mocha"* ]]; then
|
|
92
|
-
gtk_theme="Adwaita-dark"
|
|
93
|
-
shell_theme=""
|
|
94
|
-
icon_theme="Papirus-Dark"
|
|
95
|
-
color_scheme="prefer-dark"
|
|
96
|
-
else
|
|
97
|
-
gtk_theme="Adwaita"
|
|
98
|
-
shell_theme=""
|
|
99
|
-
icon_theme="Papirus"
|
|
100
|
-
color_scheme="prefer-light"
|
|
101
|
-
fi
|
|
102
|
-
;;
|
|
103
|
-
esac
|
|
104
|
-
|
|
105
|
-
log "Applying GNOME theme: $theme"
|
|
106
|
-
|
|
107
|
-
# Apply GTK theme
|
|
108
|
-
log "Setting GTK theme to: $gtk_theme"
|
|
109
|
-
gsettings set org.gnome.desktop.interface gtk-theme "$gtk_theme"
|
|
110
|
-
|
|
111
|
-
# Apply icon theme
|
|
112
|
-
log "Setting icon theme to: $icon_theme"
|
|
113
|
-
gsettings set org.gnome.desktop.interface icon-theme "$icon_theme"
|
|
114
|
-
|
|
115
|
-
# Apply cursor theme
|
|
116
|
-
log "Setting cursor theme to: $cursor_theme"
|
|
117
|
-
gsettings set org.gnome.desktop.interface cursor-theme "$cursor_theme"
|
|
118
|
-
|
|
119
|
-
# Apply color scheme (GNOME 42+)
|
|
120
|
-
if gsettings list-keys org.gnome.desktop.interface | grep -q "color-scheme"; then
|
|
121
|
-
log "Setting color scheme to: $color_scheme"
|
|
122
|
-
gsettings set org.gnome.desktop.interface color-scheme "$color_scheme"
|
|
123
|
-
fi
|
|
124
|
-
|
|
125
|
-
# Apply window manager theme
|
|
126
|
-
log "Setting window manager theme"
|
|
127
|
-
gsettings set org.gnome.desktop.wm.preferences theme "$gtk_theme"
|
|
128
|
-
|
|
129
|
-
# Apply shell theme (requires User Themes extension)
|
|
130
|
-
if [ -n "$shell_theme" ]; then
|
|
131
|
-
# Check if user-theme extension is enabled
|
|
132
|
-
if command -v gnome-extensions &>/dev/null; then
|
|
133
|
-
if gnome-extensions list --enabled | grep -q "user-theme"; then
|
|
134
|
-
log "Setting GNOME Shell theme to: $shell_theme"
|
|
135
|
-
gsettings set org.gnome.shell.extensions.user-theme name "$shell_theme"
|
|
136
|
-
else
|
|
137
|
-
warn "User Themes extension is not enabled. Shell theme not applied."
|
|
138
|
-
warn "Enable it with: gnome-extensions enable user-theme@gnome-shell-extensions.gcampax.github.com"
|
|
139
|
-
fi
|
|
140
|
-
else
|
|
141
|
-
# Fallback: try to set it anyway
|
|
142
|
-
log "Setting GNOME Shell theme to: $shell_theme"
|
|
143
|
-
gsettings set org.gnome.shell.extensions.user-theme name "$shell_theme" 2>/dev/null ||
|
|
144
|
-
warn "Could not set shell theme. User Themes extension may not be installed."
|
|
145
|
-
fi
|
|
146
|
-
fi
|
|
147
|
-
|
|
148
|
-
# Apply font settings
|
|
149
|
-
log "Setting font preferences"
|
|
150
|
-
gsettings set org.gnome.desktop.interface font-name 'Inter 10'
|
|
151
|
-
gsettings set org.gnome.desktop.interface document-font-name 'Inter 10'
|
|
152
|
-
gsettings set org.gnome.desktop.interface monospace-font-name 'JetBrains Mono 10'
|
|
153
|
-
gsettings set org.gnome.desktop.wm.preferences titlebar-font 'Inter Bold 10'
|
|
154
|
-
|
|
155
|
-
# Apply cursor size
|
|
156
|
-
gsettings set org.gnome.desktop.interface cursor-size 24
|
|
157
|
-
|
|
158
|
-
# Apply other interface settings
|
|
159
|
-
gsettings set org.gnome.desktop.interface enable-animations true
|
|
160
|
-
gsettings set org.gnome.desktop.interface enable-hot-corners true
|
|
161
|
-
gsettings set org.gnome.desktop.interface text-scaling-factor 1.0
|
|
162
|
-
|
|
163
|
-
# Apply window manager preferences
|
|
164
|
-
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'
|
|
165
|
-
gsettings set org.gnome.mutter dynamic-workspaces true
|
|
166
|
-
gsettings set org.gnome.mutter edge-tiling true
|
|
167
|
-
|
|
168
|
-
# Apply wallpaper if available
|
|
169
|
-
apply_wallpaper "$theme"
|
|
170
|
-
|
|
171
|
-
success "GNOME theme '$theme' applied successfully!"
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
# Function to apply wallpaper
|
|
175
|
-
apply_wallpaper() {
|
|
176
|
-
local theme="$1"
|
|
177
|
-
local wallpaper_path=""
|
|
178
|
-
|
|
179
|
-
# Check for system wallpapers first
|
|
180
|
-
if [ -d "/usr/share/backgrounds/catppuccin" ]; then
|
|
181
|
-
case "$theme" in
|
|
182
|
-
catppuccin-latte)
|
|
183
|
-
wallpaper_path="/usr/share/backgrounds/catppuccin/cat_latte.png"
|
|
184
|
-
;;
|
|
185
|
-
catppuccin-frappe)
|
|
186
|
-
wallpaper_path="/usr/share/backgrounds/catppuccin/cat_frappe.png"
|
|
187
|
-
;;
|
|
188
|
-
catppuccin-macchiato)
|
|
189
|
-
wallpaper_path="/usr/share/backgrounds/catppuccin/cat_macchiato.png"
|
|
190
|
-
;;
|
|
191
|
-
catppuccin-mocha)
|
|
192
|
-
wallpaper_path="/usr/share/backgrounds/catppuccin/cat_mocha.png"
|
|
193
|
-
;;
|
|
194
|
-
esac
|
|
195
|
-
fi
|
|
196
|
-
|
|
197
|
-
# Fallback to user wallpapers
|
|
198
|
-
if [ ! -f "$wallpaper_path" ] && [ -d "$HOME/.local/share/backgrounds/catppuccin" ]; then
|
|
199
|
-
case "$theme" in
|
|
200
|
-
catppuccin-latte)
|
|
201
|
-
wallpaper_path="$HOME/.local/share/backgrounds/catppuccin/cat_latte.png"
|
|
202
|
-
;;
|
|
203
|
-
catppuccin-frappe)
|
|
204
|
-
wallpaper_path="$HOME/.local/share/backgrounds/catppuccin/cat_frappe.png"
|
|
205
|
-
;;
|
|
206
|
-
catppuccin-macchiato)
|
|
207
|
-
wallpaper_path="$HOME/.local/share/backgrounds/catppuccin/cat_macchiato.png"
|
|
208
|
-
;;
|
|
209
|
-
catppuccin-mocha)
|
|
210
|
-
wallpaper_path="$HOME/.local/share/backgrounds/catppuccin/cat_mocha.png"
|
|
211
|
-
;;
|
|
212
|
-
esac
|
|
213
|
-
fi
|
|
214
|
-
|
|
215
|
-
if [ -f "$wallpaper_path" ]; then
|
|
216
|
-
log "Setting wallpaper: $wallpaper_path"
|
|
217
|
-
gsettings set org.gnome.desktop.background picture-uri "file://$wallpaper_path"
|
|
218
|
-
gsettings set org.gnome.desktop.background picture-uri-dark "file://$wallpaper_path"
|
|
219
|
-
gsettings set org.gnome.desktop.screensaver picture-uri "file://$wallpaper_path"
|
|
220
|
-
success "Wallpaper set to Catppuccin theme wallpaper"
|
|
221
|
-
else
|
|
222
|
-
warn "Catppuccin wallpaper not found for theme: $theme"
|
|
223
|
-
log "Install wallpapers with: $HOME/.dotfiles/scripts/theme/install-catppuccin-themes.sh wallpapers"
|
|
224
|
-
fi
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
# Function to backup current settings
|
|
228
|
-
backup_settings() {
|
|
229
|
-
local backup_file
|
|
230
|
-
backup_file="$HOME/.config/gnome-theme-backup-$(date +%Y%m%d-%H%M%S).dconf"
|
|
231
|
-
|
|
232
|
-
log "Backing up current GNOME settings to: $backup_file"
|
|
233
|
-
|
|
234
|
-
dconf dump /org/gnome/desktop/interface/ >"$backup_file.interface" 2>/dev/null || true
|
|
235
|
-
dconf dump /org/gnome/desktop/wm/preferences/ >"$backup_file.wm" 2>/dev/null || true
|
|
236
|
-
dconf dump /org/gnome/shell/extensions/user-theme/ >"$backup_file.shell" 2>/dev/null || true
|
|
237
|
-
|
|
238
|
-
if [ -f "$backup_file.interface" ]; then
|
|
239
|
-
success "Settings backed up successfully"
|
|
240
|
-
else
|
|
241
|
-
warn "Could not create backup. Continuing without backup."
|
|
242
|
-
fi
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
# Function to show current theme
|
|
246
|
-
show_current_theme() {
|
|
247
|
-
echo "Current GNOME theme settings:"
|
|
248
|
-
echo " GTK Theme: $(gsettings get org.gnome.desktop.interface gtk-theme)"
|
|
249
|
-
echo " Icon Theme: $(gsettings get org.gnome.desktop.interface icon-theme)"
|
|
250
|
-
echo " Cursor Theme: $(gsettings get org.gnome.desktop.interface cursor-theme)"
|
|
251
|
-
echo " Shell Theme: $(gsettings get org.gnome.shell.extensions.user-theme name 2>/dev/null || echo "'Not set or extension not available'")"
|
|
252
|
-
if gsettings list-keys org.gnome.desktop.interface | grep -q "color-scheme"; then
|
|
253
|
-
echo " Color Scheme: $(gsettings get org.gnome.desktop.interface color-scheme)"
|
|
254
|
-
fi
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
# Main execution
|
|
258
|
-
main() {
|
|
259
|
-
check_gsettings
|
|
260
|
-
|
|
261
|
-
case "$THEME_NAME" in
|
|
262
|
-
current)
|
|
263
|
-
show_current_theme
|
|
264
|
-
;;
|
|
265
|
-
backup)
|
|
266
|
-
backup_settings
|
|
267
|
-
;;
|
|
268
|
-
*)
|
|
269
|
-
# Check if theme files exist
|
|
270
|
-
theme_exists=false
|
|
271
|
-
|
|
272
|
-
case "$THEME_NAME" in
|
|
273
|
-
catppuccin-*)
|
|
274
|
-
for _d in "$HOME/.themes/Catppuccin-"*; do
|
|
275
|
-
if [ -d "$_d" ]; then
|
|
276
|
-
theme_exists=true
|
|
277
|
-
break
|
|
278
|
-
fi
|
|
279
|
-
done
|
|
280
|
-
;;
|
|
281
|
-
*)
|
|
282
|
-
theme_exists=true # Assume Adwaita and other system themes exist
|
|
283
|
-
;;
|
|
284
|
-
esac
|
|
285
|
-
|
|
286
|
-
if [ "$theme_exists" = "false" ]; then
|
|
287
|
-
warn "Catppuccin themes not found. Installing them first..."
|
|
288
|
-
"$HOME/.dotfiles/scripts/theme/install-catppuccin-themes.sh"
|
|
289
|
-
fi
|
|
290
|
-
|
|
291
|
-
backup_settings
|
|
292
|
-
apply_catppuccin_theme "$THEME_NAME"
|
|
293
|
-
;;
|
|
294
|
-
esac
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
main
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
logo_path="${DOTFILES_BOOT_LOGO:-$HOME/.config/dotfiles/boot/logo.png}"
|
|
5
|
-
APPLY=0
|
|
6
|
-
|
|
7
|
-
for arg in "$@"; do
|
|
8
|
-
case "$arg" in
|
|
9
|
-
--apply) APPLY=1 ;;
|
|
10
|
-
esac
|
|
11
|
-
done
|
|
12
|
-
|
|
13
|
-
if [[ "$(uname -s)" != "Linux" ]]; then
|
|
14
|
-
echo "Boot logo customization is Linux-only." >&2
|
|
15
|
-
exit 0
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
if [[ ! -f "$logo_path" ]]; then
|
|
19
|
-
echo "Boot logo not found: $logo_path" >&2
|
|
20
|
-
echo "Place a PNG at that path or set DOTFILES_BOOT_LOGO." >&2
|
|
21
|
-
exit 1
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
if [[ $APPLY -ne 1 ]]; then
|
|
25
|
-
echo "Dry run. Use --apply to install the boot logo." >&2
|
|
26
|
-
exit 0
|
|
27
|
-
fi
|
|
28
|
-
|
|
29
|
-
if [[ $EUID -ne 0 ]]; then
|
|
30
|
-
echo "Please run with sudo for boot logo install." >&2
|
|
31
|
-
exit 1
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
if command -v plymouth-set-default-theme >/dev/null; then
|
|
35
|
-
theme_dir="/usr/share/plymouth/themes/dotfiles"
|
|
36
|
-
mkdir -p "$theme_dir"
|
|
37
|
-
cp "$logo_path" "$theme_dir/logo.png"
|
|
38
|
-
cat >"$theme_dir/dotfiles.plymouth" <<PLY
|
|
39
|
-
[Plymouth Theme]
|
|
40
|
-
Name=Dotfiles
|
|
41
|
-
Description=Dotfiles boot splash
|
|
42
|
-
ModuleName=script
|
|
43
|
-
|
|
44
|
-
[script]
|
|
45
|
-
ImageDir=$theme_dir
|
|
46
|
-
ScriptFile=$theme_dir/dotfiles.script
|
|
47
|
-
PLY
|
|
48
|
-
|
|
49
|
-
cat >"$theme_dir/dotfiles.script" <<'SCRIPT'
|
|
50
|
-
# Simple Plymouth script
|
|
51
|
-
image = Image("logo.png");
|
|
52
|
-
image.SetPosition(Window.GetX() + Window.GetWidth()/2 - image.GetWidth()/2,
|
|
53
|
-
Window.GetY() + Window.GetHeight()/2 - image.GetHeight()/2);
|
|
54
|
-
SCRIPT
|
|
55
|
-
|
|
56
|
-
plymouth-set-default-theme -R dotfiles
|
|
57
|
-
echo "Boot logo installed via Plymouth."
|
|
58
|
-
else
|
|
59
|
-
echo "Plymouth not found. Install plymouth to apply boot logo." >&2
|
|
60
|
-
exit 1
|
|
61
|
-
fi
|