forked from adi1090x/rofi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·55 lines (47 loc) · 1.28 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
#!/usr/bin/env bash
## Author : Aditya Shakya (adi1090x)
## Github : @adi1090x
#
## Installer Script
## Colors ----------------------------
Color_Off='\033[0m'
BBlack='\033[1;30m' BRed='\033[1;31m' BGreen='\033[1;32m' BYellow='\033[1;33m'
BBlue='\033[1;34m' BPurple='\033[1;35m' BCyan='\033[1;36m' BWhite='\033[1;37m'
## Directories ----------------------------
DIR=`pwd`
FONT_DIR="$HOME/.local/share/fonts"
ROFI_DIR="$HOME/.config/rofi"
# Install Fonts
install_fonts() {
echo -e ${BBlue}"\n[*] Installing fonts..." ${Color_Off}
if [[ -d "$FONT_DIR" ]]; then
cp -rf $DIR/fonts/* "$FONT_DIR"
else
mkdir -p "$FONT_DIR"
cp -rf $DIR/fonts/* "$FONT_DIR"
fi
echo -e ${BYellow}"[*] Updating font cache...\n" ${Color_Off}
fc-cache
}
# Install Themes
install_themes() {
if [[ -d "$ROFI_DIR" ]]; then
echo -e ${BPurple}"[*] Creating a backup of your rofi configs..." ${Color_Off}
mv "$ROFI_DIR" "${ROFI_DIR}.${USER}"
fi
echo -e ${BBlue}"[*] Installing rofi configs..." ${Color_Off}
{ mkdir -p "$ROFI_DIR"; cp -rf $DIR/files/* "$ROFI_DIR"; }
if [[ -f "$ROFI_DIR/config.rasi" ]]; then
echo -e ${BGreen}"[*] Successfully Installed.\n" ${Color_Off}
exit 0
else
echo -e ${BRed}"[!] Failed to install.\n" ${Color_Off}
exit 1
fi
}
# Main
main() {
install_fonts
install_themes
}
main