summaryrefslogtreecommitdiff
path: root/.install/runall
blob: bbfe88362b9fb2a0b1b7bab7257954d570c732ee (plain)
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
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
DOTFILES_DIR="$(cd -- "$SCRIPT_DIR/.." && pwd)"

noninteractive=0
install_ohmyzsh=0
install_vencord=0

while [[ $# -gt 0 ]]; do
	case "$1" in
		--noconfirm)
			noninteractive=1
			shift
			;;
		--with-ohmyzsh)
			install_ohmyzsh=1
			shift
			;;
		--with-vencord)
			install_vencord=1
			shift
			;;
		*)
			echo "Unknown argument: $1" >&2
			echo "Usage: $0 [--noconfirm] [--with-ohmyzsh] [--with-vencord]" >&2
			exit 1
			;;
	esac
done

if [[ "$noninteractive" -eq 1 ]]; then
	"$SCRIPT_DIR/install" --noconfirm
	"$SCRIPT_DIR/aur" --noconfirm
else
	"$SCRIPT_DIR/install"
	"$SCRIPT_DIR/aur"
fi

"$SCRIPT_DIR/aetherfox"
"$SCRIPT_DIR/editor"

if [[ "$install_ohmyzsh" -eq 1 ]]; then
	if [[ -d "$HOME/.oh-my-zsh" ]]; then
		echo "oh-my-zsh already installed at $HOME/.oh-my-zsh"
	else
		echo "Installing oh-my-zsh via git clone..."
		git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh.git "$HOME/.oh-my-zsh"
	fi
fi

if [[ "$install_vencord" -eq 1 ]]; then
	tmp_script="$(mktemp)"
	trap 'rm -f "$tmp_script"' EXIT
	
	echo "Fetching Vencord installer script..."
	curl -fsSL https://vencord.dev/install.sh -o "$tmp_script"
	sh "$tmp_script"
fi

"$SCRIPT_DIR/stowall" "$DOTFILES_DIR"