Skip to content

Instantly share code, notes, and snippets.

@alessaba
Last active March 24, 2025 14:29
Show Gist options
  • Save alessaba/d000d384b68f52f2457a0a16eb4bd69d to your computer and use it in GitHub Desktop.
Save alessaba/d000d384b68f52f2457a0a16eb4bd69d to your computer and use it in GitHub Desktop.
Starting script to install all basic stuff in my linux installs
#!/bin/bash
# This script installs the necessary packages and sets up the environment for Alessaba's Linux setup.
# Supported distributions: Fedora, Arch, Debian-based systems
# Test if the user is root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root: sudo ./linux_alessaba.sh"
exit
fi
PKG_INSTALL=""
PKG_LIST="git gh hyprland hyprpaper hyprlock waybar gnome-shell btop apfs-fuse zsh sddm nautilus neovim kitty stow"
# Set hostname
read -p "Enter hostname: " hostname
hostnamectl set-hostname "$hostname"
# Set timezone
timedatectl set-timezone Europe/Rome
# Detect package manager and install packages
if [ -f /etc/fedora-release ]; then
echo "Installing packages on Fedora..."
dnf update -y
PKG_INSTALL="dnf install -y"
# Enable RPM Fusion repositories
dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
# Install Chrome
$PKG_INSTALL google-chrome
elif [ -f /etc/arch-release ]; then
echo "Installing packages on Arch..."
pacman -Syu --noconfirm
PKG_INSTALL="pacman -S --noconfirm"
# Install Chrome
$PKG_INSTALL google-chrome
elif [ -f /etc/debian_version ]; then
echo "Installing packages on Debian-based system..."
apt-get update
PKG_INSTALL="apt install -y"
# Download Chrome .deb package (not in Debian/Ubuntu repos)
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/google-chrome.deb
apt install -y /tmp/google-chrome.deb
rm /tmp/google-chrome.deb
else
echo "Unsupported distribution: $(uname -a)"
echo "Please install the following packages manually: $PKG_LIST"
exit 1
fi
# Install packages
$PKG_INSTALL $PKG_LIST
# Enable SDDM as the display manager
systemctl enable sddm.service --force
# Set Zsh as default shell
echo "Setting Zsh as the default shell..."
chsh -s $(which zsh)
# Set up Git with OAuth (GitHub CLI)
echo "Setting up Git with GitHub OAuth..."
gh auth login
# Clone dotfiles repository
echo "Cloning dotfiles repository..."
gh repo clone alessaba/dotfiles ~/dotfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment