-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·96 lines (83 loc) · 2.61 KB
/
Copy pathrun
File metadata and controls
executable file
·96 lines (83 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env bash
set -eo pipefail
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
OS="$(uname -s)"
# Ensure gum is available
if ! command -v gum &>/dev/null; then
echo "Error: gum is required. Install it first: https://github.com/charmbracelet/gum"
exit 1
fi
install_dev_tools() {
local tools
tools=$(gum choose --no-limit \
--header "Select with Space, confirm with Enter" \
"node" \
"pnpm" \
"ni" \
"rust" \
"lua" \
"git") || true
[[ -z "$tools" ]] && return
while IFS= read -r tool; do
bash "$DOTFILES_DIR/bin/core/deps-scripts/install-dev-env" "$tool"
done <<< "$tools"
}
main() {
echo "=== Dotfiles Installer ==="
echo ""
# Build menu based on OS
local menu_items=("Stow dotfiles" "Install dev tools" "Install system deps" "Install neovim" "Install tmux")
if command -v pacman &>/dev/null; then
menu_items+=("Install coolercontrol" "Snapshot omarchy" "Link 3d print files")
fi
local selections
selections=$(gum choose --no-limit \
--header "Select with Space, confirm with Enter" \
"${menu_items[@]}") || true
[[ -z "$selections" ]] && echo "Nothing selected." && exit 0
while IFS= read -r selection; do
case "$selection" in
"Stow dotfiles")
echo "[install] Stowing dotfiles..."
cd "$DOTFILES_DIR"
source "$DOTFILES_DIR/bin/core/env"
source "$DOTFILES_DIR/bin/core/setup-env"
if [[ "$OS" == "Linux" ]] && command -v hyprctl &>/dev/null; then
if gum confirm "Reload Hyprland?"; then
hyprctl reload
fi
fi
;;
"Install dev tools")
install_dev_tools
;;
"Install system deps")
echo "[install] Installing system dependencies..."
bash "$DOTFILES_DIR/bin/core/deps-scripts/install-deps"
;;
"Link 3d print files")
echo "[install] Linking 3d print files..."
bash "$DOTFILES_DIR/bin/core/deps-scripts/link-3d-print-files"
;;
"Install tmux")
echo "[install] Installing tmux..."
bash "$DOTFILES_DIR/bin/core/deps-scripts/install-tmux"
;;
"Install neovim")
echo "[install] Installing neovim..."
bash "$DOTFILES_DIR/bin/core/deps-scripts/install-nvim"
;;
"Install coolercontrol")
echo "[install] Installing coolercontrol..."
bash "$DOTFILES_DIR/bin/core/deps-scripts/install-coolercontrol"
;;
"Snapshot omarchy")
echo "[install] Snapshotting omarchy configs..."
bash "$DOTFILES_DIR/bin/.local/scripts/omarchy-snapshot"
;;
esac
done <<< "$selections"
echo ""
echo "Done!"
}
main