2022-08-13 07:34:44 -04:00
|
|
|
#!/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 ----------------------------
|
2023-05-15 19:16:56 -04:00
|
|
|
DIR="$(pwd)"
|
2022-08-13 07:34:44 -04:00
|
|
|
FONT_DIR="$HOME/.local/share/fonts"
|
|
|
|
ROFI_DIR="$HOME/.config/rofi"
|
|
|
|
|
|
|
|
# Install Fonts
|
|
|
|
install_fonts() {
|
2023-05-15 19:16:56 -04:00
|
|
|
echo -e "${BBlue}\n[*] Installing fonts..." "${Color_Off}"
|
2022-08-13 07:34:44 -04:00
|
|
|
if [[ -d "$FONT_DIR" ]]; then
|
2023-05-15 19:16:56 -04:00
|
|
|
cp -rf "$DIR/fonts/"* "$FONT_DIR"
|
2022-08-13 07:34:44 -04:00
|
|
|
else
|
|
|
|
mkdir -p "$FONT_DIR"
|
2023-05-15 19:16:56 -04:00
|
|
|
cp -rf "$DIR/fonts/"* "$FONT_DIR"
|
2022-08-13 07:34:44 -04:00
|
|
|
fi
|
2023-05-15 19:16:56 -04:00
|
|
|
echo -e "${BYellow}[*] Updating font cache...\n" "${Color_Off}"
|
2022-08-13 07:34:44 -04:00
|
|
|
fc-cache
|
|
|
|
}
|
|
|
|
|
|
|
|
# Install Themes
|
|
|
|
install_themes() {
|
|
|
|
if [[ -d "$ROFI_DIR" ]]; then
|
2023-05-15 19:16:56 -04:00
|
|
|
echo -e "${BPurple}[*] Creating a backup of your rofi configs..." "${Color_Off}"
|
2022-08-13 07:34:44 -04:00
|
|
|
mv "$ROFI_DIR" "${ROFI_DIR}.${USER}"
|
|
|
|
fi
|
2023-05-15 19:16:56 -04:00
|
|
|
echo -e "${BBlue}[*] Installing rofi configs..." "${Color_Off}"
|
|
|
|
{ mkdir -p "$ROFI_DIR"; cp -rf "$DIR/files/"* "$ROFI_DIR"; }
|
2022-08-13 07:34:44 -04:00
|
|
|
|
|
|
|
if [[ -f "$ROFI_DIR/config.rasi" ]]; then
|
2023-05-15 19:16:56 -04:00
|
|
|
echo -e "${BGreen}[*] Successfully Installed.\n" "${Color_Off}"
|
2022-08-13 07:34:44 -04:00
|
|
|
exit 0
|
|
|
|
else
|
2023-05-15 19:16:56 -04:00
|
|
|
echo -e "${BRed}[!] Failed to install.\n" "${Color_Off}"
|
2022-08-13 07:34:44 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Main
|
|
|
|
main() {
|
|
|
|
install_fonts
|
|
|
|
install_themes
|
|
|
|
}
|
|
|
|
|
|
|
|
main
|