# fluxSysTray

A system tray (notification area) as a Window Maker style dockapp for the
Fluxbox / NeoFlux slit. Applications that use the freedesktop.org System Tray
Protocol put their icons in the tile; clicks go straight to the application.

Part of the Flux Dock Apps Suite.

## What it does

- The tile never changes size. At the automatic icon size up to four icons sit
  in a 2x2 grid; a fifth switches to a 3x3 grid of smaller icons, and more
  than nine shrink further.
- An empty tile shows `TRAY`. If another system tray is already running it
  shows `TRAY IN USE` and takes over when that one exits.
- Only one fluxSysTray runs per screen: a second one names the pid of the
  first and exits with status 1, so a startup script needs no `pgrep` guard.
- Icons that follow the tray's colours (symbolic icons) are drawn in the
  tile's main colour.
- `kill -HUP` reloads the config; `SIGTERM` hands the icons back and exits.

Not done: balloon messages are ignored, and applications that only offer a
StatusNotifierItem (D-Bus) icon do not appear.

## Installation

Requires Rust and a working X11 environment.

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

## Usage

```sh
fluxSysTray                  # 96x96 tile: 32px icons, 24px from the fifth
fluxSysTray --size 128       # 48px icons, 32px from the fifth
fluxSysTray --icon-size 16   # more, smaller icons
fluxSysTray --dock 1         # NeoFlux: open in slit 1
```

### Options

| Flag | Description |
|---|---|
| `--size SIZE` | Window size in pixels, 64 to 1024 (default 96; 64, 96 and 128 are the classic dockapp sizes) |
| `--icon-size SIZE` | Icon size in pixels, 8 to 256, or `auto` (default) |
| `--font PATH` | Path to a TTF/OTF font file |
| `--theme THEME` | Colour theme: a built-in name or a theme file (see [Themes](#themes)) |
| `--background`, `--bg` | Run in background |
| `--verbose` | Show extra status messages |
| `--quiet` | Suppress informational messages |
| `--write-config [PATH]` | Write annotated config file and exit |
| `--config PATH` | Read the config from PATH instead of `~/.config/fluxSysTray/config` |
| `--dock N` | Open in slit N under NeoFlux (ignored by other window managers) |
| `--help`, `-h` | Show help message |
| `--version`, `-V` | Show the version and exit |

See also the man page and the sample `config`.

## Themes

`--theme NAME` on the command line, or `theme = NAME` in the config file,
picks a colour theme: a built-in one (`zenburn`, `high-contrast-dark`,
`autumn`, `winter` and more) or a theme file of your own. One line in
`~/.config/flux-dock-apps/config` themes every flux dock app at once.
See [THEMES.md](THEMES.md).

## Licence

CC0 1.0 where the code is not protected by copyright, GPL-3.0-or-later where
it is; see `LICENSE`. Crates built in: `THIRD-PARTY-LICENSES.txt`.
