-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·81 lines (66 loc) · 2.55 KB
/
setup.sh
File metadata and controls
executable file
·81 lines (66 loc) · 2.55 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
#!/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/"
# Automate username and switch theme in rofi config if it exists
if [ "$dir_name" == "rofi" ] && [ -f ~/.config/rofi/config.rasi ]; then
# Comment out the android theme
sed -i 's|^@theme "/usr/share/rofi/themes/android_notification.rasi"|//@theme "/usr/share/rofi/themes/android_notification.rasi"|' ~/.config/rofi/config.rasi
# Uncomment the Nord theme and replace username
sed -i "s|//@theme \"/home/YOURUSERNAME|@theme \"/home/$USER|g" ~/.config/rofi/config.rasi
echo "Automated username and switched to Nord theme in ~/.config/rofi/config.rasi"
fi
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."