Last active
September 24, 2025 13:33
-
-
Save bebetoalves/dd573694393b3d84935a0518df0370a2 to your computer and use it in GitHub Desktop.
After Install Arch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| set -o pipefail | |
| # ====== COLORS ====== | |
| BOLD="\e[1m" | |
| RESET="\e[0m" | |
| RED="\e[31m" | |
| GREEN="\e[32m" | |
| YELLOW="\e[33m" | |
| BLUE="\e[34m" | |
| step() { | |
| echo -e "${BOLD}${YELLOW}==> $1${RESET}" | |
| } | |
| substep() { | |
| echo -e "${GREEN}-- $1${RESET}" | |
| } | |
| info() { | |
| echo -e "${BLUE}$1${RESET}" | |
| } | |
| warn() { | |
| echo -e "${RED}$1${RESET}" | |
| } | |
| # ====== FUNCTIONS ====== | |
| command_exists() { | |
| command -v "$1" >/dev/null 2>&1 | |
| } | |
| # ====== START ====== | |
| step "Updating package databases..." | |
| sudo pacman -Sy --noconfirm | |
| # ========== Install packages via pacman ========== | |
| step "Installing packages via pacman..." | |
| sudo pacman -S --needed base-devel procps-ng curl file git \ | |
| zsh unzip zip unrar p7zip \ | |
| transmission-gtk openfortivpn gparted \ | |
| flameshot dbeaver \ | |
| seahorse gnome-keyring \ | |
| amd-ucode bash-completion docker docker-compose \ | |
| noto-fonts noto-fonts-extra ttf-bitstream-vera ttf-dejavu ttf-droid \ | |
| ttf-fira-mono ttf-liberation ttf-opensans ttf-roboto ttf-jetbrains-mono \ | |
| --noconfirm | |
| # ========== Nvidia Drivers ========== | |
| if command_exists nvidia-inst; then | |
| step "Installing Nvidia drivers via nvidia-inst..." | |
| sudo nvidia-inst | |
| else | |
| warn "nvidia-inst not found. Skipping Nvidia driver installation." | |
| fi | |
| # ========== Yay ========== | |
| step "Checking for yay..." | |
| if ! command_exists yay; then | |
| substep "yay not found. Installing yay from AUR..." | |
| cd /tmp | |
| git clone https://aur.archlinux.org/yay.git | |
| cd yay | |
| makepkg -si --noconfirm | |
| cd .. | |
| rm -rf yay | |
| else | |
| info "yay is already installed." | |
| fi | |
| # ========== Install AUR packages via yay ========== | |
| step "Installing AUR packages via yay..." | |
| yay -S --needed \ | |
| mint-artwork \ | |
| google-chrome \ | |
| visual-studio-code-bin \ | |
| discord \ | |
| phpstorm phpstorm-jre \ | |
| aegisub-arch1t3cht-git \ | |
| aegisub-dependency-control \ | |
| insomnia-bin \ | |
| optimus-manager \ | |
| --noconfirm | |
| # ========== Oh My Zsh ========== | |
| if [ ! -d "$HOME/.oh-my-zsh" ]; then | |
| step "Installing Oh My Zsh..." | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended | |
| else | |
| info "Oh My Zsh is already installed." | |
| fi | |
| # ========== Homebrew ========== | |
| if ! command_exists brew; then | |
| step "Installing Homebrew..." | |
| NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.zprofile | |
| eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | |
| else | |
| info "Homebrew is already installed." | |
| fi | |
| BREW_BIN="/home/linuxbrew/.linuxbrew/bin" | |
| step "Updating Homebrew..." | |
| $BREW_BIN/brew update | |
| # ========== Install packages via Homebrew ========== | |
| step "Installing packages via Homebrew..." | |
| substep "Installing PHP 8.4..." | |
| $BREW_BIN/brew tap shivammathur/php | |
| $BREW_BIN/brew install shivammathur/php/php@8.4 | |
| substep "Installing xdebug extension..." | |
| $BREW_BIN/brew tap shivammathur/extensions | |
| $BREW_BIN/brew install shivammathur/extensions/xdebug@8.4 | |
| substep "Installing memcached extension..." | |
| $BREW_BIN/brew install shivammathur/extensions/memcached@8.4 | |
| substep "Installing Composer..." | |
| $BREW_BIN/brew install composer | |
| substep "Installing Symfony CLI..." | |
| $BREW_BIN/brew install symfony-cli/tap/symfony-cli | |
| substep "Installing Node.js..." | |
| $BREW_BIN/brew install node | |
| substep "Installing Yarn..." | |
| $BREW_BIN/brew install yarn | |
| # ========== Create symlinks ========== | |
| step "Creating symbolic links to /usr/bin (if not already present)..." | |
| for bin in php composer node yarn npm; do | |
| if [ -x "$BREW_BIN/$bin" ] && [ ! -e "/usr/bin/$bin" ]; then | |
| substep "Linking $bin..." | |
| sudo ln -s "$BREW_BIN/$bin" "/usr/bin/$bin" | |
| else | |
| info "$bin already linked or not found in $BREW_BIN" | |
| fi | |
| done | |
| # ========== Docker Setup ========== | |
| step "Setting up Docker..." | |
| # Add docker-compose compatibility alias | |
| if [ ! -f "/bin/docker-compose" ]; then | |
| substep "Creating docker-compose compatibility wrapper..." | |
| echo 'docker compose --compatibility "$@"' | sudo tee /bin/docker-compose > /dev/null | |
| sudo chmod +x /bin/docker-compose | |
| else | |
| info "/bin/docker-compose already exists." | |
| fi | |
| substep "Adding user '$USER' to docker group..." | |
| sudo usermod -aG docker "$USER" | |
| substep "Enabling Docker services..." | |
| sudo systemctl enable docker.service | |
| sudo systemctl enable containerd.service | |
| sudo systemctl start docker.service | |
| # ========== Git Configuration ========== | |
| step "Configuring Git..." | |
| git config --global user.name "Bebeto Alves" | |
| git config --global user.email "bebeto.tig@gmail.com" | |
| git config --global init.defaultBranch main | |
| echo -e ".vscode\n.idea" > ~/.gitignore | |
| git config --global core.excludesfile ~/.gitignore | |
| # ========== SSH Configuration ========== | |
| step "Configuring SSH..." | |
| SSH_KEY="$HOME/.ssh/id_rsa" | |
| if [ ! -f "$SSH_KEY" ]; then | |
| substep "Generating new SSH key..." | |
| ssh-keygen -t rsa -b 2048 -C "bebeto.tig@gmail.com" -N '' -f "$SSH_KEY" | |
| else | |
| info "SSH key already exists." | |
| fi | |
| eval "$(ssh-agent -s)" | |
| ssh-add "$SSH_KEY" | |
| # ========== Time & Shell ========== | |
| step "Setting local RTC..." | |
| timedatectl set-local-rtc 1 | |
| step "Setting zsh as default shell..." | |
| if [ "$SHELL" != "$(which zsh)" ]; then | |
| sudo chsh -s "$(which zsh)" "$USER" | |
| fi | |
| # ========== Enable services ========== | |
| sudo systemctl enable --now optimus-manager | |
| # ========== Create Gnome Key Ring Service ========== | |
| AUTOSTART_DIR="$HOME/.config/autostart" | |
| mkdir -p "$AUTOSTART_DIR" | |
| DESKTOP_FILE="$AUTOSTART_DIR/gnome-keyring-ssh.desktop" | |
| cat > "$DESKTOP_FILE" <<EOL | |
| [Desktop Entry] | |
| Type=Application | |
| Name=SSH Key Agent | |
| Comment=GNOME Keyring: SSH Agent | |
| Exec=/usr/bin/gnome-keyring-daemon --start --components=ssh | |
| OnlyShowIn=GNOME;Unity;MATE;CINNAMON; | |
| X-GNOME-Autostart-Phase=PreDisplayServer | |
| X-GNOME-AutoRestart=false | |
| X-GNOME-Autostart-Notify=true | |
| X-Ubuntu-Gettext-Domain=gnome-keyring | |
| Name[en_US]=SSH Key Agent | |
| EOL | |
| chmod 644 "$DESKTOP_FILE" | |
| # ========== Finish ========== | |
| echo -e "${BOLD}${GREEN}✅ Setup completed successfully.${RESET}" | |
| echo -e "${BOLD}${YELLOW}🔁 System will reboot in 5 seconds...${RESET}" | |
| sleep 5 | |
| sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment