Skip to content

jorgemunozl/arch-i3-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Arch Linux i3 Window Manager Setup

A complete dotfiles configuration for Arch Linux with i3 window manager, designed for a CLI-first experience with fast boot times and minimal resource usage.

๐Ÿš€ Features

  • CLI-First Boot: System boots directly to command line for faster startup
  • i3 Window Manager: Lightweight, tiling window manager
  • Auto-login: Automatic login to TTY1 for immediate access
  • Custom Keybindings: Optimized shortcuts for productivity
  • Minimal Resource Usage: Fast and efficient system
  • One-Command Installation: Automated setup scripts

๐Ÿ“‹ Prerequisites

  • Fresh Arch Linux installation
  • Internet connection
  • User account with sudo privileges
  • Git installed (sudo pacman -S git)

๐Ÿ› ๏ธ Installation

Step 1: Pre-Installation Check

โš ๏ธ IMPORTANT: Always run the pre-installation check first!

# Using HTTPS (recommended for most users)
git clone https://github.com/jorgemunozl/arch-i3-setup.git
cd arch-i3-setup
./check_prereqs.sh

Note: If you have SSH keys configured, you can also use:

git clone git@github.com:jorgemunozl/arch-i3-setup.git

This will verify:

  • โœ… You're on Arch Linux
  • โœ… Internet connection works
  • โœ… You have sudo privileges
  • โœ… All configuration files are present
  • โœ… Sufficient disk space available

Step 2: Main Installation

Only proceed if the pre-check passes:

# Optional: Cache sudo password to minimize prompts
sudo -v

# Run the main installation
./install_i3.sh

Tip: sudo -v refreshes your sudo timestamp, so you won't be prompted for your password multiple times during installation.

The script will:

  • Install i3 window manager and dependencies
  • Configure auto-login to TTY1
  • Set up essential system services
  • Copy configuration files safely

Step 3: Post-Installation Setup

./post_install.sh

This adds:

  • Desktop entries
  • Wallpaper configuration
  • Utility scripts
  • User services

Step 4: Reboot

sudo reboot

๐ŸŽฏ Usage

After reboot, you'll automatically login to the command line interface.

Starting the GUI

To start the i3 window manager:

startx

Or use the custom script:

./start_i3.sh

Key Bindings

Shortcut Action
Super + Enter Open terminal
Super + d Application launcher (dmenu)
Super + Shift + q Close focused window
Super + Shift + r Restart i3
Super + Shift + e Exit i3 (instant, no confirmation)
Super + 1-9 Switch to workspace 1-9
Super + Shift + 1-9 Move window to workspace 1-9
Super + h/v Split horizontal/vertical
Super + f Toggle fullscreen
Super + Space Toggle floating window

Utility Scripts

Located in ~/scripts/:

# Brightness control
~/scripts/brightness.sh up    # Increase brightness
~/scripts/brightness.sh down  # Decrease brightness

# Volume control
~/scripts/volume.sh up        # Increase volume
~/scripts/volume.sh down      # Decrease volume
~/scripts/volume.sh mute      # Toggle mute

# Screenshots
~/scripts/screenshot.sh       # Take screenshot

๐Ÿ“ Configuration Files

arch-i3-setup/
โ”œโ”€โ”€ .config/
โ”‚   โ”œโ”€โ”€ i3/
โ”‚   โ”‚   โ””โ”€โ”€ config              # i3 window manager configuration
โ”‚   โ”œโ”€โ”€ i3status/
โ”‚   โ”‚   โ””โ”€โ”€ config              # Status bar configuration
โ”‚   โ””โ”€โ”€ alacritty/
โ”‚       โ””โ”€โ”€ alacritty.yml       # Terminal emulator configuration
โ”œโ”€โ”€ .xinitrc                    # X11 initialization (full version)
โ”œโ”€โ”€ .xinitrc.minimal            # X11 initialization (minimal version)
โ”œโ”€โ”€ .bashrc                     # Bash configuration with aliases
โ”œโ”€โ”€ install_i3.sh              # Main installation script
โ”œโ”€โ”€ post_install.sh            # Post-installation configuration
โ”œโ”€โ”€ start_i3.sh                # Script to start i3
โ””โ”€โ”€ README.md                   # This file

๐ŸŽจ Customization

X11 Initialization (.xinitrc)

The .xinitrc file controls what happens when you run startx. It includes:

Automatic Detection & Safety:

  • Checks for optional programs before running them
  • Provides fallbacks when programs aren't installed
  • Ensures i3 always starts successfully

Features:

  • Sets US keyboard layout (change setxkbmap us to your preference)
  • Starts compositor (picom) for transparency effects
  • Sets wallpaper or solid background color
  • Launches network manager applet (if installed)
  • Starts bluetooth manager (if installed)
  • Disables screen blanking
  • Launches i3 window manager

Optional Programs: If these aren't installed, .xinitrc will skip them gracefully:

sudo pacman -S picom feh network-manager-applet blueman

Minimal Version: For testing or minimal setups, use .xinitrc.minimal:

cp .xinitrc.minimal ~/.xinitrc

Wallpapers

Place your wallpaper in ~/Pictures/ as:

  • wallpaper.jpg or wallpaper.png

i3 Configuration

Edit ~/.config/i3/config to customize:

  • Key bindings
  • Workspace names
  • Window rules
  • Startup applications

Terminal

Edit ~/.config/alacritty/alacritty.yml to customize:

  • Colors
  • Fonts
  • Opacity
  • Key bindings

Aliases

Edit ~/.bashrc to add custom aliases and functions.

๐Ÿ”ง System Services

The installation configures:

  • Auto-login: Automatic login to TTY1
  • NetworkManager: Network management
  • Bluetooth: Bluetooth support
  • User services: Background applications

๐Ÿ“Š System Information

Display system info:

neofetch

Monitor system resources:

htop

๐Ÿšจ Troubleshooting & Recovery

๐Ÿ”ง Quick Fix Tool

If you're having any pacman or installation issues, use the dedicated troubleshooting tool:

./fix_pacman.sh

This interactive script will:

  • โœ… Diagnose common pacman issues
  • ๐Ÿ”ง Provide automatic fixes
  • ๐ŸŽฏ Guide you through manual solutions
  • ๐Ÿค– Auto-fix mode for common problems

๐ŸŽฎ NVIDIA Fix Tool

For NVIDIA firmware conflicts and graphics issues:

./fix_nvidia_firmware.sh

This interactive script will:

  • ๐Ÿ” Detect NVIDIA hardware and conflicts
  • ๐Ÿ› ๏ธ Resolve firmware filesystem conflicts
  • โšก Install appropriate drivers (open source or proprietary)
  • ๐Ÿ”ง Fix common NVIDIA installation issues

If Something Goes Wrong

Recovery Script: Run if installation fails

./recovery.sh

Options include:

  • Check system status
  • Restore .bashrc backup
  • Remove auto-login
  • Reset i3 to minimal config
  • Install missing packages
  • Complete removal

Common Issues

X Server / startx command not found errors

# Error: "command not found" in .xinitrc at line 56
# This happens when optional programs aren't installed

# Solution 1: Install optional packages
sudo pacman -S picom feh network-manager-applet blueman

# Solution 2: Use minimal .xinitrc (for testing)
cp .xinitrc.minimal ~/.xinitrc

# Solution 3: The .xinitrc already has safety checks - just copy it:
cp .xinitrc ~/.xinitrc

Package database update fails

# Error: "Failed to update package database!"
# Try these solutions in order:

# 1. Force refresh package databases
sudo pacman -Syy

# 2. Remove package database lock (if another pacman is stuck)
sudo rm /var/lib/pacman/db.lck
sudo pacman -Syy

# 3. Check for running pacman processes
ps aux | grep pacman
sudo killall pacman  # if any are found

# 4. Update mirrors (if repositories are slow/broken)
sudo pacman -S reflector
sudo reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist

# 5. Force full system update
sudo pacman -Syyu

NVIDIA firmware conflicts

# Error: "linux-firmware-nvidia /usr/lib/firmware/nvidia/... exists in filesystem"
# Use the dedicated NVIDIA fix tool:
./fix_nvidia_firmware.sh

# Or manual fix:
sudo pacman -S --overwrite='*' linux-firmware
sudo pacman -S --overwrite='*' nvidia nvidia-utils

X Server won't start

# Check logs
cat /var/log/Xorg.0.log

# Install graphics drivers
sudo pacman -S xf86-video-intel  # Intel
sudo pacman -S xf86-video-amdgpu # AMD
sudo pacman -S nvidia            # NVIDIA

Audio not working

sudo pacman -S pulseaudio pulseaudio-alsa
pulseaudio --start

Network issues

sudo systemctl status NetworkManager
sudo systemctl restart NetworkManager

Alacritty version compatibility issues

# If Alacritty fails to start, try the legacy config
cp ~/.config/alacritty/alacritty_legacy.yml ~/.config/alacritty/alacritty.yml

# Or install a specific Alacritty version
sudo pacman -S alacritty

Rollback Auto-login

sudo rm -f /etc/systemd/system/getty@tty1.service.d/autologin.conf

๐Ÿ”„ Updates

To update the system:

# Update packages
sudo pacman -Syu

# Update AUR packages (if yay is installed)
yay -Syu

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

๐Ÿ“ License

This project is licensed under the MIT License.

๐Ÿ‘ค Author

Jorge Muรฑoz

๐Ÿ™ Acknowledgments

๐Ÿ“š Additional Resources


Happy tiling! ๐Ÿš€

About

A seameasly setup to install the windows manager I3 on a Arch Linux Distribution, and even supports errors, (the ones which I struggled with)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages