# Installation

Install DWN on your Linux system

## Requirements

- Linux with X11 (Xorg)
- GCC compiler
- Make build system
- pkg-config

## Dependencies

### Ubuntu / Debian

    sudo apt update && sudo apt install -y \
        build-essential \
        pkg-config \
        libx11-dev \
        libxext-dev \
        libxinerama-dev \
        libxrandr-dev \
        libxft-dev \
        libxtst-dev \
        libfontconfig1-dev \
        libdbus-1-dev \
        libcurl4-openssl-dev \
        libpng-dev \
        libtesseract-dev \
        libleptonica-dev \
        tesseract-ocr \
        tesseract-ocr-eng \
        xserver-xephyr \
        dmenu

### Fedora / RHEL

    sudo dnf install -y \
        gcc make \
        pkg-config \
        libX11-devel \
        libXext-devel \
        libXinerama-devel \
        libXrandr-devel \
        libXtst-devel \
        dbus-devel \
        libcurl-devel \
        libpng-devel \
        tesseract-devel \
        leptonica-devel \
        tesseract-langpack-eng \
        xorg-x11-server-Xephyr \
        dmenu

### Arch Linux

    sudo pacman -S --needed \
        base-devel \
        pkg-config \
        libx11 \
        libxext \
        libxinerama \
        libxrandr \
        libxtst \
        dbus \
        curl \
        libpng \
        tesseract \
        tesseract-data-eng \
        leptonica \
        xorg-server-xephyr \
        dmenu

### Automatic Installation

The Makefile can automatically detect your package manager and install dependencies:

    make deps

## Building

### Clone the Repository

    git clone https://github.com/retoor/dwn.git
    cd dwn

### Build Release Version

    make

### Build Debug Version

    make debug

### Build with Sanitizers

    make sanitize

## Installing

### System-wide Installation

    sudo make install

This installs:

- `/usr/local/bin/dwn` - The window manager binary
- `/usr/local/share/xsessions/dwn.desktop` - Session file for display managers
- `/etc/dwn/config.example` - Example configuration file

### User Configuration

Copy the example configuration to your home directory:

    mkdir -p ~/.config/dwn
    cp /etc/dwn/config.example ~/.config/dwn/config

### Uninstalling

    sudo make uninstall

## Testing

### Test in Xephyr (Recommended)

Test DWN in a nested X server without affecting your current session:

    make run

This starts DWN in a 1280x720 Xephyr window on display :1.

### Manual Testing

    # Start Xephyr
    Xephyr :1 -screen 1920x1080 &

    # Run DWN on the new display
    DISPLAY=:1 ./bin/dwn

### Using DWN as Your Window Manager

1. Log out of your current session
2. At the login screen, select "DWN" from the session menu
3. Log in

Tip: Keep a terminal open or know the shortcut `Ctrl+Alt+T` to open one, in case you need to recover from any issues.