Files
dotfiles/config-scripts/install-config.sh

83 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
set -uo pipefail
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
NC='\033[0m'
# ---- Preparing for setup ----
# Testing for sudo access
if ! sudo -v; then
echo -e "${RED}Error: Failed to use sudo.${NC}" >&2
exit 1
fi
# ---- Initial setup ----
# Creating all the directories
echo -e "${YELLOW}Creating all the directories....${NC}"
mkdir -p "$HOME/.config/bash"
mkdir -p "$HOME/Documents/obsidian/Notes"
mkdir -p "$HOME/Pictures/Screenshots"
mkdir -p "$HOME/Pictures/Wallpapers"
mkdir -p "$HOME/Downloads"
mkdir -p "$HOME/Programming"
mkdir -p "$HOME/Public"
mkdir -p "$HOME/Music"
mkdir -p "$HOME/Videos"
mkdir -p "$HOME/config-scripts"
mkdir -p "$HOME/scripts"
mkdir -p "$HOME/tmp/daily"
# Creating extra files
echo -e "${YELLOW}Creating extra files....${NC}"
touch "$HOME/.bash_profile"
touch "$HOME/.bash_exports"
touch "$HOME/.inputrc"
touch "$HOME/.bashrc"
touch "$HOME/.bash_aliases"
touch "$HOME/.bash_private"
touch "$HOME/.bash_prompt"
# Creating extra links
echo -e "${YELLOW}Creating extra links....${NC}"
ln -sf "$HOME/.bash_profile" "$HOME/.config/bash/bash_profile"
ln -sf "$HOME/.bash_exports" "$HOME/.config/bash/bash_exports"
ln -sf "$HOME/.inputrc" "$HOME/.config/bash/inputrc"
ln -sf "$HOME/.bashrc" "$HOME/.config/bash/bashrc"
ln -sf "$HOME/.bash_aliases" "$HOME/.config/bash/bash_aliases"
ln -sf "$HOME/.bash_private" "$HOME/.config/bash/bash_private"
ln -sf "$HOME/.bash_prompt" "$HOME/.config/bash/bash_prompt"
# ---- Packages setup ----
# Updating package databases
echo -e "${YELLOW}Updating package databases....${NC}"
sudo pacman -Sy
# Installing the base packages
echo -e "${YELLOW}Installing the base packages....${NC}"
sudo pacman -S --needed --noconfirm git base-devel less jq inetutils
# Installing extra packages
echo -e "${YELLOW}Installing extra packages....${NC}"
sudo pacman -S --needed --noconfirm \
yadm wl-clipboard hyprland uwsm hypridle hyprlock brightnessctl \
xdg-desktop-portal-hyprland xdg-desktop-portal xdg-desktop-portal-gtk \
rofi waybar dunst awww kitty neovim yazi nwg-look grim slurp \
thunar thunar-shares-plugin thunar-archive-plugin thunar-volman \
gvfs gvfs-mtp gvfs-afc gvfs-nfs gvfs-smb gvfs-goa gvfs-wsdd gvfs-dnssd gvfs-gphoto2
# ---- Config setup ----
# This will delete all current dotfiles. Please be careful!
# Cloning config from git
echo -e "${YELLOW}Cloning config from git....${NC}"
yadm clone https://git.frik.su/Beesquit/dotfiles.git
yadm reset --hard origin/main
ya pkg upgrade
# ---- Finished ----
echo -e "${GREEN}The setup is finished!${NC}"