# fluxPager

A Window Maker style desktop pager dockapp for the Fluxbox slit. Displays
numbered buttons in a grid layout, with the current desktop highlighted.
Click buttons to switch desktops via EWMH.

Part of the [Flux Dock Apps Suite](https://osugisakae.com/software/flux-dock-apps/).

## Screenshot

```
┌──────────────┐
│  fluxPager   │
│──────────────│
│ [1] [2] [3]  │
│ [4] [5] [6]  │  ← up to 3 columns, current desktop highlighted
│ [7] [8]      │
└──────────────┘
```

## Installation

Requires Rust and a working X11 environment.

```sh
cargo build --release
cp target/release/fluxPager ~/.local/bin/
```

The release build is stripped and LTO-optimized. No runtime dependencies beyond
libc and libX11.

## Usage

```
fluxPager [OPTIONS]
```

Add `fluxPager` to your Fluxbox startup to embed it in the slit.

### Options

| Flag | Description |
|---|---|
| `--size SIZE` | Window size: 64, 96 (default), or 128 pixels |
| `--font PATH` | Path to a TTF/OTF font file |
| `--background`, `--bg` | Run in background |
| `--write-config [PATH]` | Write annotated config file and exit |
| `--configure` | Interactive configuration wizard |
| `--help` | Show help message |

### Click behavior

| Button | Action |
|---|---|
| Left click on button | Switch to that desktop |
| Left click outside buttons | Cycle to next desktop (wrapping) |
| Right click | Cycle to previous desktop (wrapping) |
| Middle click | Run `middle_click` command (if configured) |

### EWMH integration

fluxPager reads `_NET_NUMBER_OF_DESKTOPS` and `_NET_CURRENT_DESKTOP` from the
root window. Desktop switching sends a ClientMessage to the root window.
Listens for PropertyNotify on the root window for instant response to external
desktop changes, with 500ms polling as backup.

### Grid layout

Buttons are arranged in up to 3 columns with rows as needed. The current
desktop button has a filled background; others are outlined. The header shows
"fluxPager" at 96/128px sizes, "PGR" at 64px.

## Configuration

Config file: `~/.config/fluxPager/config`

Generate an annotated config:

```sh
fluxPager --write-config
```

Or use the interactive wizard:

```sh
fluxPager --configure
```

### Config options

```ini
# Window size: 64, 96, or 128 pixels
size = 96

# Font file path (leave unset for auto-detect via fontconfig)
font = /path/to/font.ttf

# Main color (R, G, B)
color = 0, 255, 0

# Dim color (R, G, B)
dim_color = 0, 200, 0

# Middle click command
middle_click =

# Run in the background
background = true
```

### Font discovery

Font is resolved in order:
1. `--font` flag or `font` config option
2. fontconfig (`fc-match monospace`)
3. Hardcoded paths (DejaVu Sans Mono, Liberation Mono, Noto Sans Mono)

## License

[CC0 1.0](LICENSE) — Public Domain
