# gliss

Wayland overlay slider. Discrete values, continuous feel.

## Usage

```bash
gliss --file /tmp/vol={value} --min 0 --max 100 --step 1 --label "音量"
```

install:
cargo install xxx
git clone this

## Parameters

| Parameter | Default | Description |
|-----------|---------|-------------|
| `--file` | | Output file. Supports `--file /tmp/vol={value}` with template |
| `--exec` | | Output command. Template same as `--file` |
| `--min` | `0` | Minimum value |
| `--max` | `100` | Maximum value |
| `--step` | `1` | Discrete step size |
| `--initial` | | Starting value (overrides file read) |
| `--rate` | `33` | Min output interval in ms. Auto-raised to 100ms with `--exec` |
| `--target` | | Target value (headless animation mode) |
| `--duration` | `200` | Animation duration in ms |
| `--anim` | `linear` | Animation curve: `linear`, `ease-out` |
| `--curve` | `linear` | Response curve: `linear`, `log`, `srgb` |
| `--label` | | Text label shown on the left (horizontal) or top (vertical) |
| `--width` | `400` | Width in pixels |
| `--height` | `32` | Height in pixels |
| `--anchor` | `top-center` | Position: `top-left`, `top-center`, `top-right`, `bottom-left`, `bottom-center`, `bottom-right` |
| `--vertical` | | Vertical orientation |
| `--slot` | `0` | Stack slot for multiple instances |
| `--gap` | `4` | Gap between stacked instances |
| `--persist` | | Stay visible (default: auto-hide after 1s) |
| `--no-touch` | | Disable all mouse interaction (display only) |
| `--no-ui` | | Headless mode (requires `--target`) |
| `--fill-color` | `#C0392B` | Fill bar color (supports `#AARRGGBB`) |
| `--track-color` | `#2A2A40` | Track background color |
| `--bg-color` | `#1C1C2C` | Surface background color |
| `--text-color` | `#F0ECE4` | Label text color |

## Template Variables

| Variable | Description |
|----------|-------------|
| `{value}` | Current value |
| `{}` | Same as `{value}` |
| `{min}` | Minimum value |
| `{max}` | Maximum value |
| `{ratio}` | 0.0–1.0 ratio |
| `{percent}` | 0–100 percentage |

## Mouse Interaction

| Action | Behavior |
|--------|----------|
| Left click | Jump to position |
| Left drag | Absolute tracking |
| Right drag | Relative adjustment (knob mode) |
| Scroll wheel | Increment/decrement by one step |

## Examples

```bash
# Basic slider writing to file
gliss --file /tmp/vol={value} --min 0 --max 100 --step 5 --label "音量"

# Vertical with log curve
gliss --file /tmp/brightness={percent} --min 0 --max 100 --step 1 \
  --vertical --curve log --label "亮度"

# Template output
gliss --file /tmp/pactl.json='{"volume":{percent}}' --min 0 --max 100 --step 1

# Command output with rate limit
gliss --exec "wpctl set-volume @DEFAULT_AUDIO_SINK@ {percent}%" \
  --min 0 --max 100 --step 1 --rate 100

# Display-only progress bar
gliss --file /tmp/progress={percent} --min 0 --max 100 \
  --label "进度" --no-touch --persist

# Semi-transparent
gliss --file /tmp/vol={value} --min 0 --max 100 --step 1 \
  --bg-color "#801C1C2C" --fill-color "#C0C0392B" --label "音量"

# Stacked sliders
gliss --file /tmp/vol={value} --min 0 --max 100 --step 1 --slot 0 --gap 4 --label "音量"
gliss --file /tmp/bri={value} --min 0 --max 100 --step 1 --slot 1 --gap 4 --label "亮度"

# Headless animation
gliss --file /tmp/vol={value} --min 0 --max 100 --target 50 --duration 500 --anim ease-out --no-ui
