Skip to content

Commit

Permalink
Initial Support For Fedora Linux
Browse files Browse the repository at this point in the history
Co-Authored-By: aayush <[email protected]>
Co-Authored-By: aayushxvf <[email protected]>
Co-Authored-By: Smriti Bhandari <[email protected]>
  • Loading branch information
4 people committed Feb 6, 2025
1 parent 8273f0d commit 06c47c8
Show file tree
Hide file tree
Showing 16 changed files with 865 additions and 353 deletions.
77 changes: 53 additions & 24 deletions core/tabs/applications-setup/alacritty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,67 @@ echo -e "${BLUE}"
figlet -f slant "Alacritty"
echo -e "${ENDCOLOR}"

checkAlacritty() {
if command -v alacritty &> /dev/null; then
printf "${GREEN}Alacritty is already installed.${RESET}\n"
confirm_continue() {
echo -e "${YELLOW}Warning: If you already have an Alacritty configuration, make sure to back it up before proceeding.${RESET}"
while true; do
read -rp "Do you want to continue with the setup? (y/n): " choice
case "$choice" in
[Yy]) break ;;
[Nn])
echo -e "${RED}Setup aborted by the user.${RESET}"
exit 1
;;
*) echo -e "${YELLOW}Please enter y or n.${RESET}" ;;
esac
done
}

installAlacritty() {
if command -v alacritty &>/dev/null; then
echo -e "${GREEN}Alacritty is already installed.${RESET}"
return
fi

echo -e "${YELLOW}Alacritty is not installed. Installing now...${RESET}"

if [ -x "$(command -v pacman)" ]; then
sudo pacman -S alacritty --noconfirm
elif [ -x "$(command -v dnf)" ]; then
sudo dnf install alacritty -y
else
printf "${YELLOW}Alacritty is not installed. :: Installing now...${RESET}\n"
if [ -x "$(command -v pacman)" ]; then
sudo pacman -S alacritty --noconfirm
elif [ -x "$(command -v apt)" ]; then
sudo apt install alacritty -y
else
printf "${RED}Unsupported package manager! Please install Alacritty manually.${RESET}\n"
exit 1
fi
printf "${GREEN}Alacritty has been installed.${RESET}\n"
echo -e "${RED}Unsupported package manager! Please install Alacritty manually.${RESET}"
exit 1
fi

echo -e "${GREEN}Alacritty has been installed.${RESET}"
}

setupAlacrittyConfig() {
printf "${CYAN}:: Copying Alacritty config files...${RESET}\n"
if [ -d "${HOME}/.config/alacritty" ] && [ ! -d "${HOME}/.config/alacritty-bak" ]; then
cp -r "${HOME}/.config/alacritty" "${HOME}/.config/alacritty-bak"
printf "${YELLOW}:: Existing Alacritty configuration backed up to alacritty-bak.${RESET}\n"
local alacritty_config="${HOME}/.config/alacritty"

echo -e "${CYAN}:: Setting up Alacritty configuration...${RESET}"

if [ -d "$alacritty_config" ] && [ ! -d "${alacritty_config}-bak" ]; then
mv "$alacritty_config" "${alacritty_config}-bak"
echo -e "${YELLOW}:: Existing Alacritty configuration backed up to alacritty-bak.${RESET}"
fi
mkdir -p "${HOME}/.config/alacritty/"
curl -sSLo "${HOME}/.config/alacritty/alacritty.toml" "https://raw.githubusercontent.com/harilvfs/dwm/refs/heads/main/config/alacritty/alacritty.toml"
curl -sSLo "${HOME}/.config/alacritty/keybinds.toml" "https://raw.githubusercontent.com/harilvfs/dwm/refs/heads/main/config/alacritty/keybinds.toml"
curl -sSLo "${HOME}/.config/alacritty/nordic.toml" "https://raw.githubusercontent.com/harilvfs/dwm/refs/heads/main/config/alacritty/nordic.toml"
printf "${GREEN}:: Alacritty configuration files copied.${RESET}\n"

mkdir -p "$alacritty_config"

base_url="https://raw.githubusercontent.com/harilvfs/dwm/refs/heads/main/config/alacritty"
for file in alacritty.toml keybinds.toml nordic.toml; do
curl -sSLo "$alacritty_config/$file" "$base_url/$file"
done

echo -e "${CYAN}:: Running 'alacritty migrate' to update the config...${RESET}"
(cd "$alacritty_config" && alacritty migrate)

echo -e "${GREEN}:: Alacritty configuration files copied and migrated.${RESET}"
}

checkAlacritty
confirm_continue
installAlacritty
setupAlacrittyConfig

printf "${GREEN}::Alacritty setup complete.${RESET}\n"
echo -e "${GREEN}:: Alacritty setup complete.${RESET}"

63 changes: 52 additions & 11 deletions core/tabs/applications-setup/fastfetch.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,85 @@ clear
GREEN='\033[0;32m'
RED='\033[0;31m'
CYAN='\033[0;36m'
NC='\033[0m'
NC='\033[0m'
BLUE="\e[34m"
ENDCOLOR="\e[0m"

echo -e "${BLUE}"
figlet -f slant "Fastfetch"

echo -e "${ENDCOLOR}"

while true; do
read -rp "Do you want to continue with the Fastfetch setup? (y/n): " choice
case "$choice" in
[Yy]) break ;;
[Nn])
echo -e "${RED}Setup aborted by the user.${NC}"
exit 1
;;
*) echo -e "${CYAN}Please enter y or n.${NC}" ;;
esac
done

FASTFETCH_DIR="$HOME/.config/fastfetch"
BACKUP_DIR="$HOME/.config/fastfetch_backup"

if command -v fastfetch &> /dev/null; then
if command -v fastfetch &>/dev/null; then
echo -e "${GREEN}Fastfetch is already installed.${NC}"
else
echo -e "${CYAN}Fastfetch is not installed. :: Installing...${NC}"
sudo pacman -S fastfetch --noconfirm
echo -e "${CYAN}Fastfetch is not installed. Installing...${NC}"

if command -v pacman &>/dev/null; then
sudo pacman -S fastfetch --noconfirm
elif command -v dnf &>/dev/null; then
sudo dnf install fastfetch -y
else
echo -e "${RED}Unsupported package manager! Please install Fastfetch manually.${NC}"
exit 1
fi
echo -e "${GREEN}Fastfetch has been installed.${NC}"
fi

if [ -d "$FASTFETCH_DIR" ]; then
echo -e "${RED}Fastfetch configuration directory already exists.${NC}"

if [ ! -d "$BACKUP_DIR" ]; then
echo -e "${CYAN}Creating backup directory...${NC}"
mkdir "$BACKUP_DIR"
mkdir -p "$BACKUP_DIR"
fi

echo -e "${CYAN}:: Backing up existing Fastfetch configuration...${NC}"
mv "$FASTFETCH_DIR"/* "$BACKUP_DIR/"
echo -e "${CYAN}Backing up existing Fastfetch configuration...${NC}"
mv "$FASTFETCH_DIR"/* "$BACKUP_DIR/" 2>/dev/null
echo -e "${GREEN}Backup completed.${NC}"
fi

echo -e "${CYAN}:: Cloning Fastfetch repository...${NC}"
echo -e "${CYAN}Cloning Fastfetch repository...${NC}"
git clone https://github.com/harilvfs/fastfetch "$FASTFETCH_DIR"

echo -e "${CYAN}:: Cleaning up unnecessary files...${NC}"
echo -e "${CYAN}Cleaning up unnecessary files...${NC}"
rm -rf "$FASTFETCH_DIR/.git" "$FASTFETCH_DIR/LICENSE" "$FASTFETCH_DIR/README.md"

echo -e "${GREEN}Fastfetch setup completed successfully!${NC}"
while true; do
read -rp "Are you using Alacritty? (y/n): " alacritty_choice
case "$alacritty_choice" in
[Yy])
echo -e "${CYAN}Applying Alacritty-specific configuration...${NC}"
if cd "$FASTFETCH_DIR"; then
rm -f config.jsonc
curl -sSLo config.jsonc "https://raw.githubusercontent.com/harilvfs/i3wmdotfiles/refs/heads/main/fastfetch/config.jsonc"
echo -e "${GREEN}Updated Fastfetch config for Alacritty.${NC}"
else
echo -e "${RED}Error: Could not change to Fastfetch directory.${NC}"
fi
break
;;
[Nn])
echo -e "${CYAN}Skipping Alacritty-specific configuration.${NC}"
break
;;
*) echo -e "${CYAN}Please enter y or n.${NC}" ;;
esac
done

echo -e "${GREEN}Fastfetch setup completed successfully!${NC}"

2 changes: 1 addition & 1 deletion core/tabs/system-setup/aur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ while true; do
figlet -f slant "Aur"
echo -e "${ENDCOLOR}"

echo -e "${CYAN}:: AUR Setup Menu${NC}"
echo -e "${CYAN}:: AUR Setup Menu [ For Arch Only ]${NC}"
echo -e "Please select an option:"
echo -e "1) Install Paru"
echo -e "2) Install Yay"
Expand Down
70 changes: 41 additions & 29 deletions scripts/Alacritty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,59 @@ figlet -f slant "Alacritty"
echo -e "${ENDCOLOR}"

confirm_continue() {
printf "${YELLOW}Warning: If you already have an Alacritty configuration, make sure to back it up before proceeding.${RESET}\n"
if gum confirm "Do you want to continue with the setup?"; then
return 0
else
printf "${RED}Setup aborted by the user.${RESET}\n"
echo -e "${YELLOW}Warning: If you already have an Alacritty configuration, make sure to back it up before proceeding.${RESET}"
if ! gum confirm "Do you want to continue with the setup?"; then
echo -e "${RED}Setup aborted by the user.${RESET}"
exit 1
fi
}

checkAlacritty() {
if command -v alacritty &> /dev/null; then
printf "${GREEN}Alacritty is already installed.${RESET}\n"
installAlacritty() {
if command -v alacritty &>/dev/null; then
echo -e "${GREEN}Alacritty is already installed.${RESET}"
return
fi

echo -e "${YELLOW}Alacritty is not installed. Installing now...${RESET}"

if [ -x "$(command -v pacman)" ]; then
sudo pacman -S alacritty --noconfirm
elif [ -x "$(command -v dnf)" ]; then
sudo dnf install alacritty -y
else
printf "${YELLOW}Alacritty is not installed. :: Installing now...${RESET}\n"
if [ -x "$(command -v pacman)" ]; then
sudo pacman -S alacritty --noconfirm
elif [ -x "$(command -v apt)" ]; then
sudo apt install alacritty -y
else
printf "${RED}Unsupported package manager! Please install Alacritty manually.${RESET}\n"
exit 1
fi
printf "${GREEN}Alacritty has been installed.${RESET}\n"
echo -e "${RED}Unsupported package manager! Please install Alacritty manually.${RESET}"
exit 1
fi

echo -e "${GREEN}Alacritty has been installed.${RESET}"
}

setupAlacrittyConfig() {
printf "${CYAN}:: Copying Alacritty config files...${RESET}\n"
if [ -d "${HOME}/.config/alacritty" ] && [ ! -d "${HOME}/.config/alacritty-bak" ]; then
cp -r "${HOME}/.config/alacritty" "${HOME}/.config/alacritty-bak"
printf "${YELLOW}:: Existing Alacritty configuration backed up to alacritty-bak.${RESET}\n"
local alacritty_config="${HOME}/.config/alacritty"

echo -e "${CYAN}:: Setting up Alacritty configuration...${RESET}"

if [ -d "$alacritty_config" ] && [ ! -d "${alacritty_config}-bak" ]; then
mv "$alacritty_config" "${alacritty_config}-bak"
echo -e "${YELLOW}:: Existing Alacritty configuration backed up to alacritty-bak.${RESET}"
fi
mkdir -p "${HOME}/.config/alacritty/"
curl -sSLo "${HOME}/.config/alacritty/alacritty.toml" "https://raw.githubusercontent.com/harilvfs/dwm/refs/heads/main/config/alacritty/alacritty.toml"
curl -sSLo "${HOME}/.config/alacritty/keybinds.toml" "https://raw.githubusercontent.com/harilvfs/dwm/refs/heads/main/config/alacritty/keybinds.toml"
curl -sSLo "${HOME}/.config/alacritty/nordic.toml" "https://raw.githubusercontent.com/harilvfs/dwm/refs/heads/main/config/alacritty/nordic.toml"
printf "${GREEN}:: Alacritty configuration files copied.${RESET}\n"

mkdir -p "$alacritty_config"

base_url="https://raw.githubusercontent.com/harilvfs/dwm/refs/heads/main/config/alacritty"
for file in alacritty.toml keybinds.toml nordic.toml; do
curl -sSLo "$alacritty_config/$file" "$base_url/$file"
done

echo -e "${CYAN}:: Running 'alacritty migrate' to update the config...${RESET}"
(cd "$alacritty_config" && alacritty migrate)

echo -e "${GREEN}:: Alacritty configuration files copied and migrated.${RESET}"
}

confirm_continue
checkAlacritty
installAlacritty
setupAlacrittyConfig

printf "${GREEN}::Alacritty setup complete.${RESET}\n"
echo -e "${GREEN}:: Alacritty setup complete.${RESET}"

5 changes: 2 additions & 3 deletions scripts/Aur.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

tput init
tput clear
clear

RED='\033[0;31m'
GREEN='\033[0;32m'
Expand Down Expand Up @@ -48,7 +47,7 @@ while true; do
figlet -f slant "Aur"
echo -e "${ENDCOLOR}"

echo -e "${CYAN}:: AUR Setup Menu${NC}"
echo -e "${CYAN}:: AUR Setup Menu [ For Arch Only ]${NC}"
choice=$(gum choose "Install Paru" "Install Yay" "Exit")

case $choice in
Expand Down
50 changes: 39 additions & 11 deletions scripts/Fastfetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ ENDCOLOR="\e[0m"

echo -e "${BLUE}"
figlet -f slant "Fastfetch"

echo -e "${ENDCOLOR}"

echo -e "${BLUE}Do you want to continue with the Fastfetch setup?${ENDCOLOR}"

if ! gum confirm "Continue with Fastfetch setup?"; then
echo -e "${RED}Setup aborted by the user.${NC}"
exit 1
Expand All @@ -25,31 +22,62 @@ fi
FASTFETCH_DIR="$HOME/.config/fastfetch"
BACKUP_DIR="$HOME/.config/fastfetch_backup"

if command -v fastfetch &> /dev/null; then
if command -v fastfetch &>/dev/null; then
echo -e "${GREEN}Fastfetch is already installed.${NC}"
else
echo -e "${CYAN}Fastfetch is not installed. :: Installing...${NC}"
sudo pacman -S fastfetch --noconfirm
echo -e "${CYAN}Fastfetch is not installed. Installing...${NC}"

if [ -x "$(command -v pacman)" ]; then
sudo pacman -S fastfetch --noconfirm
elif [ -x "$(command -v dnf)" ]; then
sudo dnf install fastfetch -y
else
echo -e "${RED}Unsupported package manager! Please install Fastfetch manually.${NC}"
exit 1
fi
echo -e "${GREEN}Fastfetch has been installed.${NC}"
fi

if [ -d "$FASTFETCH_DIR" ]; then
echo -e "${RED}Fastfetch configuration directory already exists.${NC}"

if [ ! -d "$BACKUP_DIR" ]; then
echo -e "${CYAN}Creating backup directory...${NC}"
mkdir "$BACKUP_DIR"
mkdir -p "$BACKUP_DIR"
fi

echo -e "${CYAN}:: Backing up existing Fastfetch configuration...${NC}"
mv "$FASTFETCH_DIR"/* "$BACKUP_DIR/"
echo -e "${CYAN}Backing up existing Fastfetch configuration...${NC}"
mv "$FASTFETCH_DIR"/* "$BACKUP_DIR/" 2>/dev/null
echo -e "${GREEN}Backup completed.${NC}"
fi

echo -e "${CYAN}:: Cloning Fastfetch repository...${NC}"
echo -e "${CYAN}Cloning Fastfetch repository...${NC}"
git clone https://github.com/harilvfs/fastfetch "$FASTFETCH_DIR"

echo -e "${CYAN}:: Cleaning up unnecessary files...${NC}"
echo -e "${CYAN}Cleaning up unnecessary files...${NC}"
rm -rf "$FASTFETCH_DIR/.git" "$FASTFETCH_DIR/LICENSE" "$FASTFETCH_DIR/README.md"

while true; do
read -rp "Are you using Alacritty? (y/n): " alacritty_choice
case "$alacritty_choice" in
[Yy])
echo -e "${CYAN}Applying Alacritty-specific configuration...${NC}"
if cd "$FASTFETCH_DIR"; then
rm -f config.jsonc
curl -sSLo config.jsonc "https://raw.githubusercontent.com/harilvfs/i3wmdotfiles/refs/heads/main/fastfetch/config.jsonc"
echo -e "${GREEN}Updated Fastfetch config for Alacritty.${NC}"
else
echo -e "${RED}Error: Could not change to Fastfetch directory.${NC}"
fi
break
;;
[Nn])
echo -e "${CYAN}Skipping Alacritty-specific configuration.${NC}"
break
;;
*) echo -e "${CYAN}Please enter y or n.${NC}" ;;
esac
done

echo -e "${GREEN}Fastfetch setup completed successfully!${NC}"

Loading

0 comments on commit 06c47c8

Please sign in to comment.