-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·222 lines (183 loc) · 6.39 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·222 lines (183 loc) · 6.39 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
#!/bin/bash
. scripts/_meta.sh
UBUNTU_VERSION=$(lsb_release -rs 2>/dev/null)
if [[ "$UBUNTU_VERSION" != "26.04" && "$UBUNTU_VERSION" != "25.10" ]]; then
echo "ERROR: This script requires Ubuntu 26.04. Detected: $(lsb_release -ds 2>/dev/null || echo 'unknown')"
exit 1
fi
YES=false
# Optional feature groups (both default ON). Toggled by flags or the interactive TUI.
INSTALL_MIRACLE=true
INSTALL_DEV=true
# Tracks whether the user passed any feature flag explicitly; if so we skip the TUI.
FEATURE_FLAG_SET=false
print_help() {
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " --yes Skip the interactive menu / confirmation prompt"
echo " --force Reinstall everything, ignoring 'already installed' checks"
echo " --miracle Install the miracle-wm PPAs + package (default)"
echo " --no-miracle Skip the miracle-wm PPAs + package (e.g. local build)"
echo " --dev Install developer tooling (default)"
echo " --no-dev Skip developer tooling (bun, openssh, build tools, languages)"
echo " --help Show this help message and exit"
echo ""
echo "With no --yes and no feature flag, an interactive menu is shown."
}
# Parse arguments
for arg in "$@"; do
case $arg in
--yes)
YES=true
;;
--force)
export FORCE=true
;;
--miracle)
INSTALL_MIRACLE=true
FEATURE_FLAG_SET=true
;;
--no-miracle)
INSTALL_MIRACLE=false
FEATURE_FLAG_SET=true
;;
--dev)
INSTALL_DEV=true
FEATURE_FLAG_SET=true
;;
--no-dev)
INSTALL_DEV=false
FEATURE_FLAG_SET=true
;;
--help)
print_help
exit 0
;;
*)
echo "Unknown option: $arg"
print_help
exit 1
;;
esac
done
info "Ensuring curl installation..."
apt_install_missing curl
if $YES || $FEATURE_FLAG_SET; then
info "Installation of Matt's dotfiles is starting..."
else
# Bootstrap gum for the graphical menu; tui.sh falls back to plain prompts if absent.
info "Ensuring gum installation for the interactive menu..."
apt_install_missing gum || true
. $PWD/scripts/tui.sh
info "Installation of Matt's dotfiles is starting..."
fi
if $INSTALL_MIRACLE; then
info "Adding miracle-wm PPAs..."
NEED_APT_UPDATE=false
add_ppa_if_missing() {
if ! $FORCE && grep -rq "$1" /etc/apt/sources.list.d/ 2>/dev/null; then
info "PPA $1 already added, skipping."
return
fi
sudo add-apt-repository -y --no-update "ppa:$1"
NEED_APT_UPDATE=true
}
add_ppa_if_missing "mir-team/dev"
add_ppa_if_missing "matthew-kosarek/miracle-wm"
if $NEED_APT_UPDATE; then
sudo apt update
fi
else
info "Skipping miracle-wm PPAs (--no-miracle)."
fi
info "Installing rust..."
if $FORCE || ! has_cmd cargo; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
else
info "Rust already installed, skipping."
fi
. "$HOME/.cargo/env"
. $PWD/scripts/swww.sh
. $PWD/scripts/assets.sh
if $INSTALL_MIRACLE; then
info "Installing miracle-wm..."
apt_install_missing miracle-wm
else
info "Skipping miracle-wm package (--no-miracle)."
fi
info "Installing applications dependencies from archive..."
apt_install_missing atfs wofi swaylock bat fd-find kitty network-manager-gnome fish wlogout papirus-icon-theme pamixer brightnessctl sway-notification-center grimshot waybar wl-clipboard bibata-cursor-theme slurp pavucontrol nautilus eza playerctl fastfetch
command -v snap &>/dev/null && sudo snap install bibata-all-cursor
. $PWD/scripts/fish.sh
if $INSTALL_DEV; then
info "Installing development dependencies from archive..."
apt_install_missing cmake pkg-config golang pyenv clang clangd net-tools ripgrep
info "Installing bun..."
if $FORCE || { ! has_cmd bun && [ ! -x "$HOME/.bun/bin/bun" ]; }; then
curl -fsSL https://bun.sh/install | bash
else
info "bun already installed, skipping."
fi
apt_install_missing openssh-server
sudo systemctl enable ssh
systemctl is-active --quiet systemd 2>/dev/null && sudo systemctl start ssh || true
else
info "Skipping developer tooling (--no-dev)."
fi
. $PWD/scripts/screenshare.sh
info "Installing fonts..."
. $PWD/scripts/jetbrains-mono-nerd.sh
. $PWD/scripts/fonts.sh
info "Copying bashrc..."
cp -f "bashrc" "$HOME/.bashrc"
info "Setting user permissions..."
sudo usermod -a -G video $USER || true
info "Copying kitty config..."
cp -rf "config/kitty" "$HOME/.config/"
info "Copying fish config..."
cp -rf "config/fish" "$HOME/.config/"
info "Copying waybar config..."
cp -rf "config/waybar" "$HOME/.config"
info "Copying swaylock config..."
cp -rf "config/swaylock" "$HOME/.config"
info "Copying wofi config..."
cp -rf "config/wofi" "$HOME/.config"
info "Copying wlogout config..."
cp -rf "config/wlogout" "$HOME/.config"
info "Copying swaync config..."
cp -rf "config/swaync" "$HOME/.config"
info "Copying gtk config..."
. ./scripts/gtk.sh
cp -rf "config/gtk-3.0" "$HOME/.config"
cp -rf "config/gtk-4.0" "$HOME/.config"
info "Copying newsboat config..."
mkdir -p "$HOME/.config/.newsboat"
cp "config/newsboat/config" "$HOME/.config/.newsboat/"
info "Copying miracle-wm config..."
mkdir -p "$HOME/.config/miracle-wm/plugins"
cp "config/miracle-wm/config.yaml" "$HOME/.config/miracle-wm/"
info "Downloading the latest WebAssembly plugin..."
curl -fSL -o "$HOME/.config/miracle-wm/plugins/matts_config.wasm" \
https://github.com/mattkae/dotfiles/releases/download/nightly/matts_config.wasm
info "Copying local bin files..."
mkdir -p ~/.local/bin
cp -rf local/bin/* ~/.local/bin/
info "Copying local share files..."
mkdir -p ~/.local/share
mkdir -p ~/.local/share/icons/default
cp -rf local/share/* ~/.local/share/
info "Copying Xresources..."
cp .Xresources ~/.Xresources
xrdb -load ~/.Xresources || true
info "Copying and setting cursor values..."
cp -rf "config/environment.d" "$HOME/.config"
gsettings set org.gnome.desktop.interface cursor-size 24 || true
gsettings set org.gnome.desktop.interface cursor-theme Bibata-Modern-Classic || true
gsettings set org.gnome.desktop.interface gtk-theme Dracula || true
gsettings set org.gnome.desktop.interface color-scheme prefer-dark || true
info "Setting cursor for snaps..."
if command -v snap &>/dev/null; then
for plug in $(snap connections | grep gtk-common-themes:icon-themes | awk '{print $2}'); do sudo snap connect ${plug} bibata-all-cursor:icon-themes; done
fi
success "Installation complete"