Skip to content

Instantly share code, notes, and snippets.

@KunalGautam
Created October 29, 2025 06:28
Show Gist options
  • Select an option

  • Save KunalGautam/ed66190502f80713c8b92153b761c154 to your computer and use it in GitHub Desktop.

Select an option

Save KunalGautam/ed66190502f80713c8b92153b761c154 to your computer and use it in GitHub Desktop.
hyprland setup test
#!/bin/bash
################################################################################
# Hyprland Complete Installation Script
# This script automates the installation of Hyprland and all related components
# for Arch Linux systems
################################################################################
set -e # Exit on error
# Color codes for better output readability
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
################################################################################
# Helper Functions
################################################################################
# Print colored status messages
print_status() {
echo -e "${BLUE}==>${NC} $1"
}
print_success() {
echo -e "${GREEN}✓${NC} $1"
}
print_warning() {
echo -e "${YELLOW}⚠${NC} $1"
}
print_error() {
echo -e "${RED}✗${NC} $1"
}
# Check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Pause and wait for user confirmation
pause() {
read -p "Press [Enter] to continue..."
}
################################################################################
# Step 1: Install YAY (AUR Helper)
################################################################################
install_yay() {
print_status "Installing YAY AUR helper..."
if command_exists yay; then
print_success "YAY is already installed"
return
fi
# Install base-devel if not present (required for building packages)
sudo pacman -S --needed --noconfirm base-devel git
# Clone and build yay
cd /tmp
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
cd ~
print_success "YAY installed successfully"
}
################################################################################
# Step 2: Install Core Hyprland Components
################################################################################
install_hyprland_core() {
print_status "Installing core Hyprland components..."
# Install display manager, terminal, status bar, compositor, and portal
sudo pacman -S --needed --noconfirm \
sddm \
kitty \
waybar \
hyprland \
xdg-desktop-portal-hyprland
print_success "Core Hyprland components installed"
}
################################################################################
# Step 3: Install Fonts
################################################################################
install_fonts() {
print_status "Installing fonts..."
# Install Nerd Fonts and other font packages
sudo pacman -S --needed --noconfirm \
ttf-cascadia-code-nerd \
ttf-cascadia-mono-nerd \
ttf-fira-mono \
ttf-fira-sans \
ttf-firacode-nerd \
ttf-iosevka-nerd \
ttf-iosevkaterm-nerd \
ttf-jetbrains-mono-nerd \
ttf-jetbrains-mono \
ttf-nerd-fonts-symbols \
ttf-nerd-fonts-symbols-mono \
noto-fonts-emoji \
ttf-dejavu \
noto-fonts \
noto-fonts-cjk \
noto-fonts-extra
print_success "Fonts installed"
}
################################################################################
# Step 4: Install Elephant Launcher and Extensions
################################################################################
install_elephant() {
print_status "Installing Elephant launcher and extensions..."
# Install elephant launcher and its various plugins
yay -S --needed --noconfirm \
elephant \
walker \
brave-bin \
elephant-desktopapplications \
elephant-clipboard \
elephant-emojis \
elephant-symbols \
elephant-archlinuxpkgs \
elephant-calc \
elephant-unicode
print_success "Elephant launcher installed"
}
################################################################################
# Step 5: Configure Elephant Service
################################################################################
configure_elephant_service() {
print_status "Configuring Elephant systemd service..."
# Create user systemd directory if it doesn't exist
mkdir -p ~/.config/systemd/user/
# Check if elephant.service exists
if [ ! -f ~/.config/systemd/user/elephant.service ]; then
print_warning "elephant.service not found. Please create it manually."
print_warning "Remember to change WantedBy=graphical-session.target to WantedBy=default.target"
else
# Modify the service file to use default.target instead of graphical-session.target
sed -i 's/WantedBy=graphical-session.target/WantedBy=default.target/' ~/.config/systemd/user/elephant.service
print_success "elephant.service configured"
fi
# Start and enable elephant service
systemctl --user enable elephant.service
systemctl --user start elephant.service
print_success "Elephant service enabled and started"
}
################################################################################
# Step 6: Install System Utilities
################################################################################
install_utilities() {
print_status "Installing system utilities..."
# Install brightness control, compression tools, lock/idle, and file manager
sudo pacman -S --needed --noconfirm \
brightnessctl \
tar \
unzip \
zip \
unrar \
hyprlock \
hypridle \
impala \
bluetui \
nautilus
print_success "System utilities installed"
}
################################################################################
# Step 7: Install Power Management
################################################################################
install_power_management() {
print_status "Installing power management tools..."
# Install power profiles daemon and required dependencies
yay -S --needed --noconfirm power-profiles-daemon
sudo pacman -S --needed --noconfirm python-gobject
print_success "Power management tools installed"
print_warning "You can use 'powerprofilesctl list' to see available profiles"
print_warning "Set power profile with: powerprofilesctl set power-saver"
}
################################################################################
# Step 8: Install Screenshot Tools
################################################################################
install_screenshot_tools() {
print_status "Installing screenshot tools..."
yay -S --needed --noconfirm grimblast
print_success "Screenshot tools installed (grimblast)"
}
################################################################################
# Step 9: Install Logout/Shutdown Menu
################################################################################
install_wlogout() {
print_status "Installing wlogout (logout/shutdown menu)..."
yay -S --needed --noconfirm wlogout
print_success "wlogout installed"
print_warning "Remember to configure wlogout config file for custom design"
}
################################################################################
# Step 10: Install Color Picker
################################################################################
install_color_picker() {
print_status "Installing color picker..."
yay -S --needed --noconfirm hyprpicker
print_success "Color picker installed (hyprpicker)"
}
################################################################################
# Step 11: Install Audio Control
################################################################################
install_audio_control() {
print_status "Installing audio control tools..."
yay -S --needed --noconfirm pamixer
print_success "Audio control tools installed (pamixer)"
}
################################################################################
# Step 12: Install Notification Daemon
################################################################################
install_notification_daemon() {
print_status "Installing notification daemon..."
print_warning "Choose notification daemon:"
echo "1) dunst + libnotify"
echo "2) swaync + libnotify"
read -p "Enter choice [1-2]: " notif_choice
case $notif_choice in
1)
yay -S --needed --noconfirm dunst libnotify
print_success "dunst notification daemon installed"
;;
2)
yay -S --needed --noconfirm swaync libnotify
print_success "swaync notification daemon installed"
;;
*)
print_error "Invalid choice. Skipping notification daemon installation."
;;
esac
}
################################################################################
# Step 13: Install Theming
################################################################################
install_theming() {
print_status "Installing theming tools..."
yay -S --needed --noconfirm catppuccin-gtk-theme-mocha nwg-look
print_success "Theming tools installed"
}
################################################################################
# Step 14: Install Wallpaper Manager
################################################################################
install_wallpaper() {
print_status "Installing wallpaper manager..."
yay -S --needed --noconfirm hyprpaper
print_success "Wallpaper manager installed (hyprpaper)"
}
################################################################################
# Step 15: Install SDDM Theme
################################################################################
install_sddm_theme() {
print_status "Installing SDDM Astronaut theme..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/keyitdev/sddm-astronaut-theme/master/setup.sh)"
print_success "SDDM theme installed"
}
################################################################################
# Step 16: Install Additional Tools
################################################################################
install_additional_tools() {
print_status "Installing additional tools..."
yay -S --needed --noconfirm \
btop \
fzf \
swayosd-git
print_success "Additional tools installed (btop, fzf, swayosd)"
}
################################################################################
# Step 17: Install Authentication and Keyring
################################################################################
install_auth_keyring() {
print_status "Installing polkit and gnome-keyring..."
# Install polkit-gnome for graphical authentication
yay -S --needed --noconfirm polkit-gnome
# Install gnome-keyring for credential management
sudo pacman -S --needed --noconfirm gnome-keyring libsecret
print_success "Authentication and keyring tools installed"
# Instructions for hyprland.conf
print_warning "Add the following lines to your ~/.config/hypr/hyprland.conf:"
echo -e "${YELLOW}exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1${NC}"
echo -e "${YELLOW}exec-once = gnome-keyring-daemon --start${NC}"
}
################################################################################
# Main Installation Flow
################################################################################
main() {
echo -e "${GREEN}"
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ Hyprland Complete Installation Script ║"
echo "║ For Arch Linux ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo -e "${NC}"
print_warning "This script will install Hyprland and all related components."
print_warning "Make sure you have a stable internet connection."
echo ""
pause
# Update system first
print_status "Updating system packages..."
sudo pacman -Syu --noconfirm
print_success "System updated"
# Run installation steps
install_yay
install_hyprland_core
install_fonts
install_elephant
configure_elephant_service
install_utilities
install_power_management
install_screenshot_tools
install_wlogout
install_color_picker
install_audio_control
install_notification_daemon
install_theming
install_wallpaper
install_sddm_theme
install_additional_tools
install_auth_keyring
# Final message
echo ""
echo -e "${GREEN}"
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ Installation Complete! ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo -e "${NC}"
print_success "All components have been installed successfully!"
print_warning "Next steps:"
echo " 1. Enable SDDM: sudo systemctl enable sddm"
echo " 2. Configure Hyprland: Edit ~/.config/hypr/hyprland.conf"
echo " 3. Add polkit and gnome-keyring to hyprland.conf (see above)"
echo " 4. Reboot your system"
echo ""
print_warning "Optional Brave isolated app mode:"
echo " brave --profile-directory=\"Isolated-WebsiteName\" --app=https://example.com --start-fullscreen"
}
# Run main function
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment