# 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

```
┌──────────────┐
│ [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 |
| Middle click on button | Reload config (or run `middle_click` command) |
| Right click on button | Run `right_click` command (no default action) |
| Click on blank area | Passes through to the Fluxbox slit (right-click → slit menu) |

### 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 is drawn in an accent color (`highlight_color`) with a
filled background; others are outlined in `dim_color`. Under the zenburn
theme the default accent is a warm yellow (`240, 221, 158`) with black
labels so the active workspace pops against the tan palette.

## 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

# Highlight color for the current-desktop button (R, G, B)
# Defaults to color, or to 240,221,158 when theme = zenburn
highlight_color = 240, 221, 158

# Middle click command (default: reload config)
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
