-
Notifications
You must be signed in to change notification settings - Fork 0
/
copyConfig.sh
executable file
·96 lines (74 loc) · 2.61 KB
/
copyConfig.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
# ANSI escape codes for color formatting
RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
BLUE="\e[34m"
RESET="\e[0m"
CONFIG_DIR=$HOME/.config
FILES_DIR=$(pwd)/others
THEME_DIR=$HOME/.themes
# I put themes before config just in case.
cd themes
for f in *; do
rm -r $THEME_DIR/$f
cp -r $f $THEME_DIR
done
cd ../config
for f in *; do
rm -r $CONFIG_DIR/$f
cp -r $f $CONFIG_DIR
done
sudo mkdir -p $HOME/.oh-my-zsh/custom/ && sudo cp -r $FILES_DIR/oh-my-zsh/custom/* $HOME/.oh-my-zsh/custom/
cp $FILES_DIR/.zshrc $HOME
sudo cp $FILES_DIR/grub /etc/default/
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo cp $FILES_DIR/pacman.conf /etc/
sudo cp $FILES_DIR/reflector.conf /etc/xdg/reflector/
sudo cp $FILES_DIR/sudoers /etc/
# copy spotify.desktop file
cd
echo -e "${YELLOW}Configuring spotify...${RESET}"
sudo cp $FILES_DIR/spotify-adblock.desktop /usr/share/applications/
sudo rm -f /usr/share/applications/spotify.desktop
if [ $? -ne 0 ]; then
echo -e "${RED}Error configuring spotify.${RESET}"
notify-send "Error configuring spotify" "There was a problem configuring spotify. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Spotify configured successfully.${RESET}"
fi
# Copy my custom PATH variables
cd
echo -e "${YELLOW}Copying profile...${RESET}"
sudo cp $FILES_DIR/profile /etc/
if [ $? -ne 0 ]; then
echo -e "${RED}Error copying profile.${RESET}"
notify-send "Error copying profile" "There was a problem copying profile. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Profile copied successfully.${RESET}"
fi
# Copy rules (that will be executed at the startup of the system):
cd
echo -e "${YELLOW}Copying rules...${RESET}"
sudo cp $FILES_DIR/../rules/* /etc/udev/rules.d/
if [ $? -ne 0 ]; then
echo -e "${RED}Error copying rules.${RESET}"
notify-send "Error copying rules" "There was a problem copying rules. Please check the installation process." --urgency=critical
else
echo -e "${GREEN}Rules copied successfully.${RESET}"
fi
# tlp (battery management)
# echo -e "${YELLOW}Configuring tlp...${RESET}"
# systemctl mask systemd-rfkill.service
# systemctl mask systemd-rfkill.socket
# systemctl enable tlp.service
# sudo tlp start
# sudo cp Desktop/dotfiles/others/tlp.conf /etc/
# if [ $? -ne 0 ]; then
# echo -e "${RED}Error configuring tlp.${RESET}"
# notify-send "Error configuring tlp" "There was a problem configuring tlp. Please check the installation process." --urgency=critical
# else
# echo -e "${GREEN}Tlp configured successfully.${RESET}"
# fi
${CONFIG_DIR}/hypr/scripts/get_bing_image.sh
echo 'Done!'