-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·126 lines (96 loc) · 2.79 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·126 lines (96 loc) · 2.79 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
#!/bin/bash
set -e
REPO_URL="https://github.com/Times-Z/dotfiles.git"
REPO_NAME="dotfiles"
if [[ "${BASH_SOURCE[0]}" != "$0" || ! -f "$(dirname "${BASH_SOURCE[0]}")/pacman.txt" ]]; then
echo "[INFO] Bootstrapping from remote..."
TMPDIR=$(mktemp -d)
if ! command -v git &> /dev/null; then
sudo pacman -S --needed git
fi
git clone --depth=1 "$REPO_URL" "$TMPDIR/$REPO_NAME"
exec bash "$TMPDIR/$REPO_NAME/install.sh" "$@"
exit 0
fi
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
if ! pacman -Qi base-devel &>/dev/null; then
echo "[INFO] Installing base-devel (required for yay and AUR builds)..."
sudo pacman -S --needed --noconfirm base-devel
fi
if ! command -v yay &> /dev/null; then
echo "[INFO] yay not found, installing..."
sudo pacman -S go
git clone https://aur.archlinux.org/yay.git /tmp/yay
(cd /tmp/yay && makepkg -si --noconfirm)
fi
if [ -f pacman.txt ]; then
echo "[INFO] Installing pacman packages..."
PKGS=$(grep -vE '^[ \t]*#' pacman.txt | xargs)
set +e
sudo pacman -Sy --needed --noconfirm $PKGS
status=$?
set -e
if [ $status -ne 0 ]; then
echo
echo "[WARN] Conflicts detected. Switching to interactive mode..."
sudo pacman -Syu --needed $PKGS < /dev/tty
fi
else
echo "[WARN] pacman.txt not found."
fi
if [ -f yay.txt ]; then
echo "[INFO] Installing AUR packages..."
YAY_PKGS=$(grep -vE '^[ \t]*#' yay.txt | xargs)
set +e
yay -Sy --needed --noconfirm $YAY_PKGS
status=$?
set -e
if [ $status -ne 0 ]; then
echo
echo "[WARN] AUR conflicts detected. Switching to interactive mode..."
yay -S --needed $YAY_PKGS < /dev/tty
fi
else
echo "[WARN] yay.txt not found."
fi
echo "[INFO] All packages installed."
echo "[INFO] Copying configuration files..."
copy_config() {
local src=$1
local dest=$2
rm -rf "$dest"
cp -rf "$src" "$dest"
echo "[INFO] Copy $src to $dest"
}
CONFIG_DIRS=(
clipse
MangoHud
gpicview
hypr
kitty
lsfg-vk
nvim
ranger
rofi
systemd
vkBasalt
streamrip
waybar
wayle
wireplumber
xdg-desktop-portal
)
for dir in "${CONFIG_DIRS[@]}"; do
copy_config "$dir" "$HOME/.config/$dir"
done
mkdir -p "$HOME/.local/share/fonts"
cp -rf fonts/* "$HOME/.local/share/fonts/"
fc-cache -fv
sudo cp -f pipewire.conf.d/samplerate.conf /etc/pipewire/pipewire.conf.d
cp -f .zshrc "$HOME/.zshrc"
cp -f brave-flags.conf "$HOME/.config/brave-flags.conf"
cp -f chromium-flags.conf "$HOME/.config/chromium-flags.conf"
cp -f user-dirs.conf "$HOME/.config/user-dirs.conf"
cp -f user-dirs.locale "$HOME/.config/user-dirs.locale"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "[INFO] Done!"