@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,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# JSON validator and formatter
|
|
3
|
-
# Usage: jsonv <file> | jsonv (reads stdin) | jsonv --format <file>
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
FORMAT=false
|
|
8
|
-
QUIET=false
|
|
9
|
-
|
|
10
|
-
while [[ $# -gt 0 ]]; do
|
|
11
|
-
case "$1" in
|
|
12
|
-
-f|--format) FORMAT=true; shift ;;
|
|
13
|
-
-q|--quiet) QUIET=true; shift ;;
|
|
14
|
-
-*) echo "Unknown option: $1"; exit 1 ;;
|
|
15
|
-
*) break ;;
|
|
16
|
-
esac
|
|
17
|
-
done
|
|
18
|
-
|
|
19
|
-
validate_json() {
|
|
20
|
-
local input="$1"
|
|
21
|
-
if command -v jq >/dev/null 2>&1; then
|
|
22
|
-
if $FORMAT; then
|
|
23
|
-
jq '.' <<< "$input"
|
|
24
|
-
else
|
|
25
|
-
jq -e '.' <<< "$input" >/dev/null 2>&1
|
|
26
|
-
fi
|
|
27
|
-
elif command -v python3 >/dev/null 2>&1; then
|
|
28
|
-
if $FORMAT; then
|
|
29
|
-
python3 -m json.tool <<< "$input"
|
|
30
|
-
else
|
|
31
|
-
python3 -c "import json; json.loads('''$input''')" 2>/dev/null
|
|
32
|
-
fi
|
|
33
|
-
else
|
|
34
|
-
echo "Error: jq or python3 required"
|
|
35
|
-
exit 1
|
|
36
|
-
fi
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
# Read input
|
|
40
|
-
if [[ $# -gt 0 ]] && [[ -f "$1" ]]; then
|
|
41
|
-
INPUT=$(cat "$1")
|
|
42
|
-
SOURCE="$1"
|
|
43
|
-
else
|
|
44
|
-
INPUT=$(cat)
|
|
45
|
-
SOURCE="stdin"
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
if validate_json "$INPUT"; then
|
|
49
|
-
$QUIET || echo "✓ Valid JSON ($SOURCE)"
|
|
50
|
-
exit 0
|
|
51
|
-
else
|
|
52
|
-
echo "✗ Invalid JSON ($SOURCE)"
|
|
53
|
-
exit 1
|
|
54
|
-
fi
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# JWT token decoder
|
|
3
|
-
# Usage: jwt <token> | jwt (reads from stdin)
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
decode_base64url() {
|
|
8
|
-
local input="$1"
|
|
9
|
-
# Add padding
|
|
10
|
-
local mod=$((${#input} % 4))
|
|
11
|
-
if [[ $mod -eq 2 ]]; then input="${input}=="; fi
|
|
12
|
-
if [[ $mod -eq 3 ]]; then input="${input}="; fi
|
|
13
|
-
# Convert URL-safe to standard base64
|
|
14
|
-
echo "$input" | tr '-_' '+/' | base64 -d 2>/dev/null || base64 -D <<< "$(echo "$input" | tr '-_' '+/')"
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
format_json() {
|
|
18
|
-
if command -v jq >/dev/null 2>&1; then
|
|
19
|
-
jq '.' 2>/dev/null || cat
|
|
20
|
-
elif command -v python3 >/dev/null 2>&1; then
|
|
21
|
-
python3 -m json.tool 2>/dev/null || cat
|
|
22
|
-
else
|
|
23
|
-
cat
|
|
24
|
-
fi
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
# Get token
|
|
28
|
-
if [[ $# -gt 0 ]]; then
|
|
29
|
-
TOKEN="$1"
|
|
30
|
-
else
|
|
31
|
-
read -r TOKEN
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
# Remove 'Bearer ' prefix if present
|
|
35
|
-
TOKEN="${TOKEN#Bearer }"
|
|
36
|
-
TOKEN="${TOKEN#bearer }"
|
|
37
|
-
|
|
38
|
-
# Split into parts
|
|
39
|
-
IFS='.' read -ra PARTS <<< "$TOKEN"
|
|
40
|
-
|
|
41
|
-
if [[ ${#PARTS[@]} -lt 2 ]]; then
|
|
42
|
-
echo "Error: Invalid JWT format"
|
|
43
|
-
exit 1
|
|
44
|
-
fi
|
|
45
|
-
|
|
46
|
-
echo "=== Header ==="
|
|
47
|
-
decode_base64url "${PARTS[0]}" | format_json
|
|
48
|
-
echo ""
|
|
49
|
-
|
|
50
|
-
echo "=== Payload ==="
|
|
51
|
-
PAYLOAD=$(decode_base64url "${PARTS[1]}")
|
|
52
|
-
echo "$PAYLOAD" | format_json
|
|
53
|
-
echo ""
|
|
54
|
-
|
|
55
|
-
# Check expiration
|
|
56
|
-
if command -v jq >/dev/null 2>&1; then
|
|
57
|
-
EXP=$(echo "$PAYLOAD" | jq -r '.exp // empty' 2>/dev/null)
|
|
58
|
-
IAT=$(echo "$PAYLOAD" | jq -r '.iat // empty' 2>/dev/null)
|
|
59
|
-
|
|
60
|
-
if [[ -n "$EXP" ]]; then
|
|
61
|
-
NOW=$(date +%s)
|
|
62
|
-
EXP_DATE=$(date -d "@$EXP" 2>/dev/null || date -r "$EXP" 2>/dev/null)
|
|
63
|
-
if [[ $EXP -lt $NOW ]]; then
|
|
64
|
-
echo "⚠️ Token EXPIRED at: $EXP_DATE"
|
|
65
|
-
else
|
|
66
|
-
echo "✓ Token expires at: $EXP_DATE"
|
|
67
|
-
fi
|
|
68
|
-
fi
|
|
69
|
-
|
|
70
|
-
if [[ -n "$IAT" ]]; then
|
|
71
|
-
IAT_DATE=$(date -d "@$IAT" 2>/dev/null || date -r "$IAT" 2>/dev/null)
|
|
72
|
-
echo " Issued at: $IAT_DATE"
|
|
73
|
-
fi
|
|
74
|
-
fi
|
|
75
|
-
|
|
76
|
-
echo ""
|
|
77
|
-
echo "=== Signature ==="
|
|
78
|
-
echo "(${#PARTS[2]} characters, verification requires secret key)"
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Kill process running on specified port
|
|
3
|
-
# Usage: kill-port <port> [--force]
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
if [[ $# -lt 1 ]]; then
|
|
8
|
-
echo "Usage: kill-port <port> [--force]"
|
|
9
|
-
echo "Example: kill-port 3000"
|
|
10
|
-
exit 1
|
|
11
|
-
fi
|
|
12
|
-
|
|
13
|
-
PORT="$1"
|
|
14
|
-
FORCE=false
|
|
15
|
-
[[ "${2:-}" == "--force" || "${2:-}" == "-f" ]] && FORCE=true
|
|
16
|
-
|
|
17
|
-
# Validate port number
|
|
18
|
-
if ! [[ "$PORT" =~ ^[0-9]+$ ]] || [[ "$PORT" -lt 1 ]] || [[ "$PORT" -gt 65535 ]]; then
|
|
19
|
-
echo "Error: Invalid port number: $PORT"
|
|
20
|
-
exit 1
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
# Find process using the port
|
|
24
|
-
find_pid() {
|
|
25
|
-
if command -v lsof >/dev/null 2>&1; then
|
|
26
|
-
lsof -ti ":$PORT" 2>/dev/null
|
|
27
|
-
elif command -v ss >/dev/null 2>&1; then
|
|
28
|
-
ss -tlnp "sport = :$PORT" 2>/dev/null | awk 'NR>1 {match($0, /pid=([0-9]+)/, a); print a[1]}'
|
|
29
|
-
elif command -v netstat >/dev/null 2>&1; then
|
|
30
|
-
netstat -tlnp 2>/dev/null | awk -v port=":$PORT" '$4 ~ port {split($7, a, "/"); print a[1]}'
|
|
31
|
-
else
|
|
32
|
-
echo "Error: No supported tool found (lsof, ss, or netstat required)"
|
|
33
|
-
exit 1
|
|
34
|
-
fi
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
PIDS=$(find_pid)
|
|
38
|
-
|
|
39
|
-
if [[ -z "$PIDS" ]]; then
|
|
40
|
-
echo "No process found on port $PORT"
|
|
41
|
-
exit 0
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
echo "Found process(es) on port $PORT:"
|
|
45
|
-
for pid in $PIDS; do
|
|
46
|
-
ps -p "$pid" -o pid,comm,args --no-headers 2>/dev/null || echo " PID: $pid"
|
|
47
|
-
done
|
|
48
|
-
|
|
49
|
-
if $FORCE; then
|
|
50
|
-
SIGNAL="-9"
|
|
51
|
-
echo "Force killing..."
|
|
52
|
-
else
|
|
53
|
-
SIGNAL="-15"
|
|
54
|
-
echo "Sending SIGTERM..."
|
|
55
|
-
fi
|
|
56
|
-
|
|
57
|
-
for pid in $PIDS; do
|
|
58
|
-
kill $SIGNAL "$pid" 2>/dev/null && echo "Killed PID $pid" || echo "Failed to kill PID $pid"
|
|
59
|
-
done
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Lorem ipsum text generator
|
|
3
|
-
# Usage: lorem [words|sentences|paragraphs] [count]
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
# Lorem ipsum word pool
|
|
8
|
-
WORDS=(
|
|
9
|
-
"lorem" "ipsum" "dolor" "sit" "amet" "consectetur" "adipiscing" "elit"
|
|
10
|
-
"sed" "do" "eiusmod" "tempor" "incididunt" "ut" "labore" "et" "dolore"
|
|
11
|
-
"magna" "aliqua" "enim" "ad" "minim" "veniam" "quis" "nostrud"
|
|
12
|
-
"exercitation" "ullamco" "laboris" "nisi" "aliquip" "ex" "ea" "commodo"
|
|
13
|
-
"consequat" "duis" "aute" "irure" "in" "reprehenderit" "voluptate"
|
|
14
|
-
"velit" "esse" "cillum" "fugiat" "nulla" "pariatur" "excepteur" "sint"
|
|
15
|
-
"occaecat" "cupidatat" "non" "proident" "sunt" "culpa" "qui" "officia"
|
|
16
|
-
"deserunt" "mollit" "anim" "id" "est" "laborum" "perspiciatis" "unde"
|
|
17
|
-
"omnis" "iste" "natus" "error" "voluptatem" "accusantium" "doloremque"
|
|
18
|
-
"laudantium" "totam" "rem" "aperiam" "eaque" "ipsa" "quae" "ab" "illo"
|
|
19
|
-
"inventore" "veritatis" "quasi" "architecto" "beatae" "vitae" "dicta"
|
|
20
|
-
"explicabo" "nemo" "ipsam" "quia" "voluptas" "aspernatur" "aut" "odit"
|
|
21
|
-
"fugit" "consequuntur" "magni" "dolores" "eos" "ratione" "sequi"
|
|
22
|
-
"nesciunt" "neque" "porro" "quisquam" "dolorem" "adipisci" "numquam"
|
|
23
|
-
"eius" "modi" "tempora" "incidunt" "magnam" "quaerat"
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
random_word() {
|
|
27
|
-
echo "${WORDS[$RANDOM % ${#WORDS[@]}]}"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
generate_sentence() {
|
|
31
|
-
local word_count=$((RANDOM % 10 + 5))
|
|
32
|
-
local sentence=""
|
|
33
|
-
for ((i = 0; i < word_count; i++)); do
|
|
34
|
-
if [[ $i -eq 0 ]]; then
|
|
35
|
-
word=$(random_word)
|
|
36
|
-
sentence="${word^}"
|
|
37
|
-
else
|
|
38
|
-
sentence="$sentence $(random_word)"
|
|
39
|
-
fi
|
|
40
|
-
done
|
|
41
|
-
echo "$sentence."
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
generate_paragraph() {
|
|
45
|
-
local sentence_count=$((RANDOM % 4 + 3))
|
|
46
|
-
local paragraph=""
|
|
47
|
-
for ((i = 0; i < sentence_count; i++)); do
|
|
48
|
-
if [[ $i -eq 0 ]]; then
|
|
49
|
-
paragraph=$(generate_sentence)
|
|
50
|
-
else
|
|
51
|
-
paragraph="$paragraph $(generate_sentence)"
|
|
52
|
-
fi
|
|
53
|
-
done
|
|
54
|
-
echo "$paragraph"
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
# Parse arguments
|
|
58
|
-
TYPE="${1:-paragraphs}"
|
|
59
|
-
COUNT="${2:-1}"
|
|
60
|
-
|
|
61
|
-
case "$TYPE" in
|
|
62
|
-
w|word|words)
|
|
63
|
-
for ((i = 0; i < COUNT; i++)); do
|
|
64
|
-
if [[ $i -eq 0 ]]; then
|
|
65
|
-
word=$(random_word)
|
|
66
|
-
echo -n "${word^}"
|
|
67
|
-
else
|
|
68
|
-
echo -n " $(random_word)"
|
|
69
|
-
fi
|
|
70
|
-
done
|
|
71
|
-
echo
|
|
72
|
-
;;
|
|
73
|
-
s|sentence|sentences)
|
|
74
|
-
for ((i = 0; i < COUNT; i++)); do
|
|
75
|
-
generate_sentence
|
|
76
|
-
done
|
|
77
|
-
;;
|
|
78
|
-
p|paragraph|paragraphs)
|
|
79
|
-
for ((i = 0; i < COUNT; i++)); do
|
|
80
|
-
generate_paragraph
|
|
81
|
-
[[ $i -lt $((COUNT - 1)) ]] && echo
|
|
82
|
-
done
|
|
83
|
-
;;
|
|
84
|
-
-h|--help)
|
|
85
|
-
echo "Usage: lorem [type] [count]"
|
|
86
|
-
echo ""
|
|
87
|
-
echo "Types:"
|
|
88
|
-
echo " words, w Generate words"
|
|
89
|
-
echo " sentences, s Generate sentences"
|
|
90
|
-
echo " paragraphs, p Generate paragraphs (default)"
|
|
91
|
-
echo ""
|
|
92
|
-
echo "Examples:"
|
|
93
|
-
echo " lorem # 1 paragraph"
|
|
94
|
-
echo " lorem p 3 # 3 paragraphs"
|
|
95
|
-
echo " lorem words 10 # 10 words"
|
|
96
|
-
echo " lorem sentences 5 # 5 sentences"
|
|
97
|
-
;;
|
|
98
|
-
*)
|
|
99
|
-
echo "Unknown type: $TYPE"
|
|
100
|
-
echo "Use: words, sentences, or paragraphs"
|
|
101
|
-
exit 1
|
|
102
|
-
;;
|
|
103
|
-
esac
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Regex tester
|
|
3
|
-
# Usage: regex <pattern> <string> | regex -f <pattern> <file>
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
usage() {
|
|
8
|
-
echo "Usage: regex [OPTIONS] <pattern> [string|file]"
|
|
9
|
-
echo ""
|
|
10
|
-
echo "Options:"
|
|
11
|
-
echo " -f, --file Test against file contents"
|
|
12
|
-
echo " -g, --global Find all matches"
|
|
13
|
-
echo " -i, --ignore Case insensitive"
|
|
14
|
-
echo " -m, --multiline Multiline mode"
|
|
15
|
-
echo " -c, --color Colorize matches"
|
|
16
|
-
echo " -h, --help Show this help"
|
|
17
|
-
echo ""
|
|
18
|
-
echo "Examples:"
|
|
19
|
-
echo " regex '[0-9]+' 'abc123def' # Test pattern"
|
|
20
|
-
echo " regex -g '[a-z]+' 'hello world' # Find all"
|
|
21
|
-
echo " regex -f '^#' config.txt # Test file"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
FILE_MODE=false
|
|
25
|
-
GLOBAL=false
|
|
26
|
-
IGNORE_CASE=""
|
|
27
|
-
COLOR=true
|
|
28
|
-
|
|
29
|
-
while [[ $# -gt 0 ]]; do
|
|
30
|
-
case "$1" in
|
|
31
|
-
-f|--file) FILE_MODE=true; shift ;;
|
|
32
|
-
-g|--global) GLOBAL=true; shift ;;
|
|
33
|
-
-i|--ignore) IGNORE_CASE="-i"; shift ;;
|
|
34
|
-
-c|--color) COLOR=true; shift ;;
|
|
35
|
-
--no-color) COLOR=false; shift ;;
|
|
36
|
-
-h|--help) usage; exit 0 ;;
|
|
37
|
-
-*) echo "Unknown option: $1"; usage; exit 1 ;;
|
|
38
|
-
*) break ;;
|
|
39
|
-
esac
|
|
40
|
-
done
|
|
41
|
-
|
|
42
|
-
if [[ $# -lt 1 ]]; then
|
|
43
|
-
usage
|
|
44
|
-
exit 1
|
|
45
|
-
fi
|
|
46
|
-
|
|
47
|
-
PATTERN="$1"
|
|
48
|
-
shift
|
|
49
|
-
|
|
50
|
-
# Get input
|
|
51
|
-
if $FILE_MODE; then
|
|
52
|
-
if [[ $# -lt 1 ]] || [[ ! -f "$1" ]]; then
|
|
53
|
-
echo "Error: File required for -f mode"
|
|
54
|
-
exit 1
|
|
55
|
-
fi
|
|
56
|
-
INPUT=$(cat "$1")
|
|
57
|
-
elif [[ $# -gt 0 ]]; then
|
|
58
|
-
INPUT="$*"
|
|
59
|
-
else
|
|
60
|
-
INPUT=$(cat)
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
# Color settings
|
|
64
|
-
if $COLOR; then
|
|
65
|
-
GREP_COLOR="--color=always"
|
|
66
|
-
else
|
|
67
|
-
GREP_COLOR="--color=never"
|
|
68
|
-
fi
|
|
69
|
-
|
|
70
|
-
# Test and show matches
|
|
71
|
-
echo "Pattern: $PATTERN"
|
|
72
|
-
echo "---"
|
|
73
|
-
|
|
74
|
-
if $GLOBAL; then
|
|
75
|
-
# Find all matches
|
|
76
|
-
if echo "$INPUT" | grep -oE $IGNORE_CASE "$PATTERN" $GREP_COLOR; then
|
|
77
|
-
echo "---"
|
|
78
|
-
MATCH_COUNT=$(echo "$INPUT" | grep -oE $IGNORE_CASE "$PATTERN" | wc -l)
|
|
79
|
-
echo "✓ Found $MATCH_COUNT match(es)"
|
|
80
|
-
else
|
|
81
|
-
echo "✗ No matches found"
|
|
82
|
-
exit 1
|
|
83
|
-
fi
|
|
84
|
-
else
|
|
85
|
-
# Test if pattern matches
|
|
86
|
-
if echo "$INPUT" | grep -qE $IGNORE_CASE "$PATTERN"; then
|
|
87
|
-
echo "$INPUT" | grep -E $IGNORE_CASE "$PATTERN" $GREP_COLOR
|
|
88
|
-
echo "---"
|
|
89
|
-
echo "✓ Pattern matches"
|
|
90
|
-
else
|
|
91
|
-
echo "$INPUT"
|
|
92
|
-
echo "---"
|
|
93
|
-
echo "✗ Pattern does not match"
|
|
94
|
-
exit 1
|
|
95
|
-
fi
|
|
96
|
-
fi
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# tmux-sessionizer - Fuzzy session switcher for tmux
|
|
3
|
-
#
|
|
4
|
-
# This script provides a fuzzy-finder interface for switching between
|
|
5
|
-
# tmux sessions and creating new sessions from project directories.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
# tmux-sessionizer [directory]
|
|
9
|
-
#
|
|
10
|
-
# If no directory is provided, uses fzf to select from:
|
|
11
|
-
# - Existing tmux sessions
|
|
12
|
-
# - Project directories from configured paths
|
|
13
|
-
#
|
|
14
|
-
# Configuration:
|
|
15
|
-
# Set TMUX_SESSIONIZER_DIRS to customise search paths (colon-separated)
|
|
16
|
-
# Default: ~/projects:~/work:~/src:~/.dotfiles
|
|
17
|
-
#
|
|
18
|
-
# References:
|
|
19
|
-
# - ThePrimeagen's original: https://github.com/ThePrimeagen/.dotfiles
|
|
20
|
-
|
|
21
|
-
set -euo pipefail
|
|
22
|
-
|
|
23
|
-
# Configuration
|
|
24
|
-
SESSIONIZER_DIRS="${TMUX_SESSIONIZER_DIRS:-$HOME/projects:$HOME/work:$HOME/src:$HOME/.dotfiles}"
|
|
25
|
-
|
|
26
|
-
# Colours for output
|
|
27
|
-
readonly RED='\033[0;31m'
|
|
28
|
-
readonly GREEN='\033[0;32m'
|
|
29
|
-
readonly NC='\033[0m' # No Colour
|
|
30
|
-
|
|
31
|
-
log_error() {
|
|
32
|
-
echo -e "${RED}Error:${NC} $1" >&2
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
log_info() {
|
|
36
|
-
echo -e "${GREEN}Info:${NC} $1"
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
# Check dependencies
|
|
40
|
-
if ! command -v fzf &>/dev/null; then
|
|
41
|
-
log_error "fzf is required but not installed."
|
|
42
|
-
exit 1
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
|
-
if ! command -v tmux &>/dev/null; then
|
|
46
|
-
log_error "tmux is required but not installed."
|
|
47
|
-
exit 1
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
# Get list of directories to search (as newline-separated list for safe iteration)
|
|
51
|
-
get_search_dirs() {
|
|
52
|
-
local paths
|
|
53
|
-
IFS=':' read -ra paths <<< "$SESSIONIZER_DIRS"
|
|
54
|
-
for path in "${paths[@]}"; do
|
|
55
|
-
# Expand tilde
|
|
56
|
-
local expanded_path="${path/#\~/$HOME}"
|
|
57
|
-
if [[ -d "$expanded_path" ]]; then
|
|
58
|
-
printf '%s\n' "$expanded_path"
|
|
59
|
-
fi
|
|
60
|
-
done
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
# Get list of project directories
|
|
64
|
-
get_projects() {
|
|
65
|
-
local search_dirs
|
|
66
|
-
search_dirs=$(get_search_dirs)
|
|
67
|
-
|
|
68
|
-
if [[ -z "$search_dirs" ]]; then
|
|
69
|
-
return
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
# Find directories (1-2 levels deep) - iterate safely over newline-separated dirs
|
|
73
|
-
while IFS= read -r dir; do
|
|
74
|
-
find "$dir" -mindepth 1 -maxdepth 2 -type d 2>/dev/null
|
|
75
|
-
done <<< "$search_dirs" | sort -u
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
# Get list of existing tmux sessions
|
|
79
|
-
get_sessions() {
|
|
80
|
-
tmux list-sessions -F "#{session_name}" 2>/dev/null || true
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
# Format session name from directory path (sanitized for tmux)
|
|
84
|
-
format_session_name() {
|
|
85
|
-
local dir="$1"
|
|
86
|
-
local name
|
|
87
|
-
|
|
88
|
-
# Get basename, replace dots with underscores, and strip unsafe chars
|
|
89
|
-
name=$(basename "$dir" | tr '.' '_' | tr -cd '[:alnum:]._-')
|
|
90
|
-
|
|
91
|
-
# Remove leading numbers/dashes for cleaner names
|
|
92
|
-
name="${name##[0-9_-]}"
|
|
93
|
-
name="${name##[0-9_-]}"
|
|
94
|
-
name="${name##[0-9_-]}"
|
|
95
|
-
|
|
96
|
-
# If name is empty after cleanup, use sanitized full basename
|
|
97
|
-
if [[ -z "$name" ]]; then
|
|
98
|
-
name=$(basename "$dir" | tr -cd '[:alnum:]._-')
|
|
99
|
-
fi
|
|
100
|
-
|
|
101
|
-
# Limit length for safety
|
|
102
|
-
echo "${name:0:32}"
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
# Switch to or create a tmux session
|
|
106
|
-
switch_to_session() {
|
|
107
|
-
local selected="$1"
|
|
108
|
-
local session_name
|
|
109
|
-
|
|
110
|
-
if [[ -z "$selected" ]]; then
|
|
111
|
-
log_error "No selection made."
|
|
112
|
-
exit 0
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
# Check if selection is an existing session
|
|
116
|
-
if tmux has-session -t="$selected" 2>/dev/null; then
|
|
117
|
-
session_name="$selected"
|
|
118
|
-
else
|
|
119
|
-
# It's a directory - create or switch to session
|
|
120
|
-
if [[ ! -d "$selected" ]]; then
|
|
121
|
-
log_error "Directory does not exist: $selected"
|
|
122
|
-
exit 1
|
|
123
|
-
fi
|
|
124
|
-
|
|
125
|
-
session_name=$(format_session_name "$selected")
|
|
126
|
-
|
|
127
|
-
# Create session if it doesn't exist
|
|
128
|
-
if ! tmux has-session -t="$session_name" 2>/dev/null; then
|
|
129
|
-
tmux new-session -ds "$session_name" -c "$selected"
|
|
130
|
-
log_info "Created new session: $session_name"
|
|
131
|
-
fi
|
|
132
|
-
fi
|
|
133
|
-
|
|
134
|
-
# Switch to the session
|
|
135
|
-
if [[ -z "${TMUX:-}" ]]; then
|
|
136
|
-
# Not inside tmux - attach directly
|
|
137
|
-
tmux attach-session -t "$session_name"
|
|
138
|
-
else
|
|
139
|
-
# Inside tmux - switch client
|
|
140
|
-
tmux switch-client -t "$session_name"
|
|
141
|
-
fi
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
# Main function
|
|
145
|
-
main() {
|
|
146
|
-
local selected
|
|
147
|
-
|
|
148
|
-
# If argument provided, use it directly
|
|
149
|
-
if [[ $# -eq 1 ]]; then
|
|
150
|
-
selected="$1"
|
|
151
|
-
else
|
|
152
|
-
# Build selection list: existing sessions + project directories
|
|
153
|
-
local sessions projects combined
|
|
154
|
-
|
|
155
|
-
sessions=$(get_sessions)
|
|
156
|
-
projects=$(get_projects)
|
|
157
|
-
|
|
158
|
-
# Combine and deduplicate
|
|
159
|
-
if [[ -n "$sessions" ]] && [[ -n "$projects" ]]; then
|
|
160
|
-
combined=$(printf "%s\n%s" "$sessions" "$projects" | sort -u)
|
|
161
|
-
elif [[ -n "$sessions" ]]; then
|
|
162
|
-
combined="$sessions"
|
|
163
|
-
elif [[ -n "$projects" ]]; then
|
|
164
|
-
combined="$projects"
|
|
165
|
-
else
|
|
166
|
-
log_error "No sessions or project directories found."
|
|
167
|
-
exit 1
|
|
168
|
-
fi
|
|
169
|
-
|
|
170
|
-
# Use fzf for selection
|
|
171
|
-
selected=$(echo "$combined" | fzf \
|
|
172
|
-
--height=50% \
|
|
173
|
-
--layout=reverse \
|
|
174
|
-
--border=rounded \
|
|
175
|
-
--prompt="Session > " \
|
|
176
|
-
--header="Select a session or directory" \
|
|
177
|
-
--preview='if [ -d {} ]; then ls -la {}; else tmux capture-pane -pt {} -p 2>/dev/null | head -20; fi' \
|
|
178
|
-
--preview-window=right:50%:wrap \
|
|
179
|
-
--bind='ctrl-d:preview-page-down' \
|
|
180
|
-
--bind='ctrl-u:preview-page-up' \
|
|
181
|
-
) || exit 0
|
|
182
|
-
fi
|
|
183
|
-
|
|
184
|
-
switch_to_session "$selected"
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
main "$@"
|