Desktop Environment Setup

Quick Reference

# Install Hyprland
sudo pacman -S hyprland

# Install common desktop tools
sudo pacman -S \
    kitty waybar wofi dunst \
    grim slurp wl-clipboard \
    thunar pavucontrol

# Start from TTY
Hyprland

Choosing a Desktop

Desktop Options

Type Options Best For

Full DE

GNOME, KDE Plasma, XFCE

Complete out-of-box experience

Tiling WM (Wayland)

Hyprland, Sway, river

Power users, customization

Tiling WM (X11)

i3, bspwm, awesome

Legacy, specific needs

Stacking WM

openbox, fluxbox

Lightweight, traditional

Wayland vs X11

Modern systems should prefer Wayland:

  • Better security (app isolation)

  • Better HiDPI support

  • Smoother performance

  • Active development

X11 still needed for:

  • Some legacy apps (via XWayland)

  • NVIDIA on older drivers

  • Specific software requirements

Hyprland Setup

Installation

# Core packages
sudo pacman -S hyprland

# XDG Desktop Portal (for screen sharing)
sudo pacman -S xdg-desktop-portal-hyprland

# Terminal (pick one)
sudo pacman -S kitty           # GPU-accelerated, popular
sudo pacman -S ghostty         # Modern, fast, native Wayland
sudo pacman -S alacritty       # Minimal, config-file based
sudo pacman -S foot            # Lightweight, Wayland-native

# Application launcher
sudo pacman -S wofi

# Status bar
sudo pacman -S waybar

# Notifications (pick one)
sudo pacman -S mako            # Lightweight, wlroots-native
sudo pacman -S dunst           # Feature-rich, X11 and Wayland

# Screenshots
sudo pacman -S grim slurp

# Clipboard
sudo pacman -S wl-clipboard cliphist

# File manager
sudo pacman -S thunar

# Audio control
sudo pacman -S pavucontrol

# Wallpaper
sudo pacman -S swww

# Screen locker
sudo pacman -S swaylock swayidle

# Authentication agent
sudo pacman -S polkit-kde-agent

# All in one command
sudo pacman -S hyprland xdg-desktop-portal-hyprland kitty wofi waybar dunst grim slurp wl-clipboard cliphist thunar pavucontrol swww swaylock swayidle polkit-kde-agent

First Configuration

# Create config directory
mkdir -p ~/.config/hypr

# Copy example config
cp /usr/share/hyprland/hyprland.conf ~/.config/hypr/

# Or start fresh
nvim ~/.config/hypr/hyprland.conf

Basic hyprland.conf

# ~/.config/hypr/hyprland.conf

# Monitor configuration
monitor=,preferred,auto,1

# Autostart
exec-once = waybar
exec-once = mako               # Or: dunst
exec-once = swww init && swww img ~/wallpaper.png
exec-once = wl-paste --watch cliphist store
exec-once = /usr/lib/polkit-kde-authentication-agent-1
exec-once = swayidle -w timeout 300 'swaylock -f' timeout 600 'hyprctl dispatch dpms off'

# Environment variables
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORM,wayland
env = MOZ_ENABLE_WAYLAND,1
env = GDK_BACKEND,wayland

# Input
input {
    kb_layout = us
    kb_options = caps:escape
    follow_mouse = 1
    touchpad {
        natural_scroll = true
        tap-to-click = true
    }
}

# General settings
general {
    gaps_in = 5
    gaps_out = 10
    border_size = 2
    col.active_border = rgba(33ccffee)
    col.inactive_border = rgba(595959aa)
    layout = dwindle
}

# Decoration
decoration {
    rounding = 10
    blur {
        enabled = true
        size = 8
        passes = 2
    }
    drop_shadow = true
}

# Animations
animations {
    enabled = true
    bezier = myBezier, 0.05, 0.9, 0.1, 1.05
    animation = windows, 1, 7, myBezier
    animation = fade, 1, 7, default
    animation = workspaces, 1, 6, default
}

# Key bindings
$mod = SUPER

bind = $mod, Return, exec, kitty
bind = $mod, D, exec, wofi --show drun
bind = $mod, Q, killactive
bind = $mod, F, fullscreen
bind = $mod, V, togglefloating
bind = $mod SHIFT, M, exit

# Focus
bind = $mod, H, movefocus, l
bind = $mod, L, movefocus, r
bind = $mod, K, movefocus, u
bind = $mod, J, movefocus, d

# Workspaces
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5

bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5

# Mouse bindings
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow

# Screenshot
bind = , Print, exec, grim ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png
bind = SHIFT, Print, exec, grim -g "$(slurp)" ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png
bind = $mod, Print, exec, grim - | wl-copy

# Volume (requires wireplumber)
binde = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
binde = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle

# Brightness (requires brightnessctl)
binde = , XF86MonBrightnessUp, exec, brightnessctl set 5%+
binde = , XF86MonBrightnessDown, exec, brightnessctl set 5%-

Starting Hyprland

# From TTY (recommended)
Hyprland

# Auto-start from TTY1
# Add to ~/.bash_profile or ~/.zprofile
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then
    exec Hyprland
fi

Sway Setup

Installation

# Core packages
sudo pacman -S sway swaylock swayidle swaybg

# Additional tools
sudo pacman -S foot wofi waybar mako grim slurp wl-clipboard

# XDG portal
sudo pacman -S xdg-desktop-portal-wlr

Basic Configuration

# Copy default config
mkdir -p ~/.config/sway
cp /etc/sway/config ~/.config/sway/

# Edit configuration
nvim ~/.config/sway/config

Key Differences from i3

# Sway config (differs from i3)

# Output (monitors)
output * bg ~/wallpaper.png fill
output DP-1 resolution 3840x2160 position 0,0 scale 1.5

# Input
input type:keyboard {
    xkb_layout us
    xkb_options caps:escape
}

input type:touchpad {
    tap enabled
    natural_scroll enabled
}

KDE Plasma

Installation

# Full installation
sudo pacman -S plasma-meta kde-applications-meta

# Minimal installation
sudo pacman -S plasma-desktop sddm konsole dolphin

# Enable display manager
sudo systemctl enable sddm

# For Wayland session
sudo pacman -S plasma-wayland-session

Start KDE

# Reboot to SDDM, or
startplasma-wayland    # Wayland
startplasma-x11        # X11

GNOME

Installation

# Full installation
sudo pacman -S gnome gnome-extra

# Minimal installation
sudo pacman -S gnome-shell gnome-control-center gnome-terminal nautilus gdm

# Enable display manager
sudo systemctl enable gdm

GNOME Tweaks

# Install gnome-tweaks for customization
sudo pacman -S gnome-tweaks

# Extensions
sudo pacman -S gnome-shell-extensions
yay -S gnome-shell-extension-appindicator

Essential Desktop Tools

Audio (PipeWire)

# Install PipeWire stack
sudo pacman -S pipewire pipewire-pulse pipewire-alsa pipewire-jack wireplumber

# Enable
systemctl --user enable --now pipewire pipewire-pulse wireplumber

# Audio control
sudo pacman -S pavucontrol

Bluetooth

# Install bluetooth
sudo pacman -S bluez bluez-utils

# Enable
sudo systemctl enable --now bluetooth

# GUI
sudo pacman -S blueman

Fonts

# Essential fonts
sudo pacman -S \
    ttf-dejavu \
    ttf-liberation \
    noto-fonts \
    noto-fonts-cjk \
    noto-fonts-emoji \
    ttf-font-awesome \
    ttf-jetbrains-mono

# Nerd fonts (from AUR)
yay -S ttf-jetbrains-mono-nerd
yay -S nerd-fonts-complete

Themes and Icons

# GTK themes
sudo pacman -S arc-gtk-theme papirus-icon-theme

# For Qt apps matching GTK
sudo pacman -S qt5ct qt6ct

# Environment variables
# ~/.config/environment.d/qt.conf
QT_QPA_PLATFORMTHEME=qt5ct

Screen Sharing

# Install portal for your compositor
# Hyprland
sudo pacman -S xdg-desktop-portal-hyprland

# wlroots (Sway)
sudo pacman -S xdg-desktop-portal-wlr

# GNOME
sudo pacman -S xdg-desktop-portal-gnome

# KDE
sudo pacman -S xdg-desktop-portal-kde

# Restart portal service
systemctl --user restart xdg-desktop-portal

Night Light / Blue Light Filter

# For Hyprland/Sway
sudo pacman -S gammastep

# Configuration
# ~/.config/gammastep/config.ini
[general]
temp-day=6500
temp-night=4000
location-provider=manual

[manual]
lat=40.7
lon=-74.0

# Autostart
exec-once = gammastep

NVIDIA Configuration

Install Drivers

# Proprietary drivers
sudo pacman -S nvidia nvidia-utils nvidia-settings

# Or DKMS version (for multiple kernels)
sudo pacman -S nvidia-dkms nvidia-utils nvidia-settings

# For Wayland
sudo pacman -S egl-wayland

Environment Variables

# ~/.config/hypr/hyprland.conf
env = LIBVA_DRIVER_NAME,nvidia
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = WLR_NO_HARDWARE_CURSORS,1

# Kernel parameter (in boot entry)
options ... nvidia_drm.modeset=1

mkinitcpio for NVIDIA

# /etc/mkinitcpio.conf
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)

# Rebuild
sudo mkinitcpio -P

Display Manager (Optional)

SDDM (KDE)

sudo pacman -S sddm
sudo systemctl enable sddm

GDM (GNOME)

sudo pacman -S gdm
sudo systemctl enable gdm

LightDM

sudo pacman -S lightdm lightdm-gtk-greeter
sudo systemctl enable lightdm

ly (Minimal TUI)

sudo pacman -S ly
sudo systemctl enable ly

Application Categories

File Managers

# GUI
sudo pacman -S thunar           # GTK, lightweight
sudo pacman -S dolphin          # KDE
sudo pacman -S nautilus         # GNOME
sudo pacman -S pcmanfm          # Very lightweight

# Terminal
sudo pacman -S ranger           # Vim-like
sudo pacman -S lf               # Fast, minimal
yay -S yazi                     # Modern, async

Browsers

sudo pacman -S firefox
sudo pacman -S chromium
yay -S brave-bin
yay -S google-chrome

Media

# Video player
sudo pacman -S mpv vlc

# Image viewer
sudo pacman -S imv feh

# PDF viewer
sudo pacman -S zathura zathura-pdf-mupdf

# Music
sudo pacman -S cmus
yay -S spotify

Development

# Editors
sudo pacman -S neovim code

# Terminal emulators
sudo pacman -S kitty alacritty foot

# Version control
sudo pacman -S git lazygit

Troubleshooting

Black Screen on Boot

# Switch to TTY
Ctrl+Alt+F2

# Check logs
journalctl -b -p err
cat /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log

# Common fixes:
# - Wrong NVIDIA config
# - Missing portal
# - Wrong GPU being used

Apps Not Launching

# Check WAYLAND_DISPLAY
echo $WAYLAND_DISPLAY

# Force XWayland for problematic apps
env GDK_BACKEND=x11 problematic-app
env QT_QPA_PLATFORM=xcb problematic-app

Screen Sharing Not Working

# Check portal status
systemctl --user status xdg-desktop-portal
systemctl --user status xdg-desktop-portal-hyprland

# Restart
systemctl --user restart xdg-desktop-portal

# Update environment
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

Slow Application Launch

# Add to exec-once (Hyprland)
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

Quick Reference

# Hyprland
hyprctl monitors              # List monitors
hyprctl clients               # List windows
hyprctl dispatch exec APP     # Launch app
hyprctl reload                # Reload config

# Screenshots
grim                          # Full screen
grim -g "$(slurp)"           # Selection
grim - | wl-copy             # To clipboard

# Clipboard
wl-copy < file               # Copy file
wl-paste                     # Paste
cliphist list | wofi --dmenu | cliphist decode | wl-copy

# Screen recording
wf-recorder                  # Record screen
wf-recorder -g "$(slurp)"    # Record region

# Config locations
~/.config/hypr/hyprland.conf
~/.config/waybar/config
~/.config/wofi/config
~/.config/dunst/dunstrc
~/.config/kitty/kitty.conf