-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall-all.sh
More file actions
executable file
·85 lines (73 loc) · 2.47 KB
/
Copy pathinstall-all.sh
File metadata and controls
executable file
·85 lines (73 loc) · 2.47 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
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status
set -u # Treat unset variables as an error and exit immediately
# Get user's home directory
USER_HOME=$(eval echo ~"$SUDO_USER")
# Function to print messages
log() {
echo -e "\033[1;32m[INFO]\033[0m $1"
}
# Ensure the script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root." >&2
exit 1
fi
log "Updating system and installing base-devel and git..."
pacman -S --needed --noconfirm base-devel git
# Clone and install Yay
if ! command -v yay &> /dev/null; then
log "Installing Yay AUR helper..."
sudo -u "$SUDO_USER" git clone https://aur.archlinux.org/yay.git /tmp/yay
pushd /tmp/yay >/dev/null
sudo -u "$SUDO_USER" makepkg -si --noconfirm
popd >/dev/null
rm -rf /tmp/yay
else
log "Yay is already installed. Skipping..."
fi
# Install dependencies from deps file
if [[ -f deps ]]; then
log "Installing dependencies from 'deps' file..."
xargs -a deps -r -- pacman -S --needed --noconfirm
else
log "No 'deps' file found. Skipping..."
fi
# Install AUR dependencies from yay-deps file
if [[ -f yay-deps ]]; then
log "Installing AUR dependencies from 'yay-deps' file..."
sudo -u "$SUDO_USER" xargs -a yay-deps -r -- yay -S --needed --noconfirm
else
log "No 'yay-deps' file found. Skipping..."
fi
# Clone GTK theme and icon theme
THEME_PATH="$USER_HOME/.themes/Material-*"
ICON_PATH="$USER_HOME/.local/share/icons/WhiteSur-red-dark"
if [[ ! -d "$THEME_PATH" ]]; then
log "Installing GTK theme..."
sudo -u "$SUDO_USER" mkdir -p "$USER_HOME/.themes"
sudo -u "$SUDO_USER" git clone https://github.com/rtlewis1/GTK.git -b Material-Black-Colors-Desktop /tmp/gtk
pushd /tmp/gtk >/dev/null
sudo -u "$SUDO_USER" cp -r * "$USER_HOME/.themes/"
popd >/dev/null
rm -rf /tmp/gtk
else
log "GTK theme Material-Black-Cherry already installed. Skipping..."
fi
if [[ ! -d "$ICON_PATH" ]]; then
log "Installing ICON theme..."
sudo -u "$SUDO_USER" git clone https://github.com/vinceliuice/WhiteSur-icon-theme.git /tmp/iconws
pushd /tmp/iconws >/dev/null
sudo -u "$SUDO_USER" ./install.sh -t all -a
popd >/dev/null
rm -rf /tmp/iconws
else
log "ICON theme WhiteSur-red-dark already installed. Skipping..."
fi
# Execute paste-dots.sh if it exists and is executable
if [[ -x paste-dots.sh ]]; then
log "Executing 'paste-dots.sh'..."
sudo -u "$SUDO_USER" ./paste-dots.sh
else
log "'paste-dots.sh' not found or not executable. Skipping..."
fi
log "Installation complete!"