-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·72 lines (58 loc) · 1.9 KB
/
setup.sh
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
#!/bin/bash
# Function to install dependencies for Arch-based distributions
install_arch() {
sudo pacman -Syu --noconfirm
sudo pacman -S --noconfirm base-devel libconfig dbus libev libx11 libxcb libxext libgl libegl libepoxy meson pcre2 pixman uthash xcb-util-image xcb-util-renderutil xorgproto cmake
}
# Install the packages for Arch Linux
echo "Installing packages for Arch Linux..."
install_arch
picom_animations() {
# Clone the repository in the home/build directory
mkdir -p ~/build
if [ ! -d ~/build/picom ]; then
if ! git clone https://github.com/FT-Labs/picom.git ~/build/picom; then
echo "Failed to clone the repository"
return 1
fi
else
echo "Repository already exists, skipping clone"
fi
cd ~/build/picom || { echo "Failed to change directory to picom"; return 1; }
# Build the project
if ! meson setup --buildtype=release build; then
echo "Meson setup failed"
return 1
fi
if ! ninja -C build; then
echo "Ninja build failed"
return 1
fi
# Install the built binary
if ! sudo ninja -C build install; then
echo "Failed to install the built binary"
return 1
fi
echo "Picom animations installed successfully"
}
clone_config_folders() {
# Ensure the target directory exists
[ ! -d ~/.config ] && mkdir -p ~/.config
# Iterate over all directories in config/*
for dir in config/*/; do
# Extract the directory name
dir_name=$(basename "$dir")
# Clone the directory to ~/.config/
if [ -d "$dir" ]; then
cp -r "$dir" ~/.config/
echo "Cloned $dir_name to ~/.config/"
else
echo "Directory $dir_name does not exist, skipping"
fi
done
}
# Call the function
clone_config_folders
# Call the function
picom_animations
echo "All dependencies installed successfully."