107 lines
3.3 KiB
Bash
Executable File
107 lines
3.3 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
|
|
echo -e "${YELLOW}Preparing for setup. Please allow sudo....${NC}"
|
|
if ! sudo -v; then
|
|
echo -e "${RED}Error: Failed to use sudo.${NC}" >&2
|
|
exit 1
|
|
fi
|
|
echo
|
|
|
|
# ---- 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/os-releases"
|
|
mkdir -p "$HOME/tmp/daily"
|
|
mkdir -p "$HOME/.wireguard"
|
|
echo
|
|
|
|
# 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_tools"
|
|
touch "$HOME/.bash_prompt"
|
|
touch "$HOME/.multiplexer"
|
|
cp /etc/os-release "$HOME/.os-release"
|
|
echo
|
|
|
|
# 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_tools" "$HOME/.config/bash/bash_tools"
|
|
ln -sf "$HOME/.bash_prompt" "$HOME/.config/bash/bash_prompt"
|
|
ln -sf "$HOME/.multiplexer" "$HOME/.config/bash/multiplexer"
|
|
echo
|
|
|
|
# ---- Packages setup ----
|
|
# Updating package databases
|
|
echo -e "${YELLOW}Updating package databases....${NC}"
|
|
sudo pacman -Sy
|
|
echo
|
|
|
|
# Installing the base packages
|
|
echo -e "${YELLOW}Installing the base packages....${NC}"
|
|
sudo pacman -S --needed --noconfirm git base-devel less jq inetutils python
|
|
echo
|
|
|
|
# Installing extra packages
|
|
echo -e "${YELLOW}Installing extra packages....${NC}"
|
|
sudo pacman -S --needed --noconfirm \
|
|
ethtool ldns bash bash-completion zoxide yadm hyprland uwsm \
|
|
wl-clipboard brightnessctl ttf-jetbrains-mono-nerd \
|
|
xdg-desktop-portal-hyprland xdg-desktop-portal \
|
|
xdg-desktop-portal-gtk xdg-desktop-portal-wlr archlinux-xdg-menu \
|
|
rofi waybar dunst awww hyprpicker hypridle hyprlock \
|
|
kitty yazi nwg-look grim slurp btop ncdu nmap exfat-utils abduco \
|
|
neovim vi vim tree-sitter-cli ripgrep fzf nano zip \
|
|
shfmt stylua prettier ruff bash-language-server \
|
|
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 fastfetch cowsay
|
|
echo
|
|
|
|
# ---- 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
|
|
echo
|
|
|
|
# ---- Finalizing setup ----
|
|
echo -e "${YELLOW}Finalizing setup....${NC}"
|
|
ya pkg upgrade
|
|
xdg-mime default thunar.desktop inode/directory
|
|
echo
|
|
|
|
# ---- Finished ----
|
|
echo -e "${GREEN}The setup is finished!${NC}"
|