# Tech HUD Iconbar (`tech-hud-iconbar`)

A minimalistic, highly customizable Tech-HUD holo-style iconbar and program launcher for X11, combining the classic program launcher functionality of Azteker with the advanced vector HUD theming, corner-circling border animations, and live-apply graphical settings of the Tech HUD Taskbar.

---

## Key Features

- **Tech-HUD Vector Styling**:
  - 20 Cairo-rendered color themes (Cyber Cyan, Matrix Emerald, Amber Terminal, Crimson Alert, Neon Purple, Solar Gold, Deep Space Blue, Obsidian Dark, Synthwave Pink, etc.).
  - 11 panel and button styles (Classic HUD Box, Top-Notch Tapered Header, Slanted Vent, Armored Hex Box, Dual Angular Chamfers, Glass Minimalist, etc.).
- **Interactive Animations**:
  - Live corner-circling border light segment pulses with per-button delay and speed controls.
  - Smooth hover glow, press alpha feedback, background wave pulses, and scanlines.
- **Custom Cairo HUD Tooltips**:
  - Floating, theme-matched HUD tooltips with glowing accent borders and corner brackets.
  - Adaptive screen-clamping geometry (automatically flips above or to the left when near screen edges).
- **Flexible Layout & Positioning**:
  - Horizontal row or Vertical column orientations.
  - Top, Bottom, Left, Right, Center, or custom pixel-based edge positioning.
  - Multi-monitor support via target monitor (Xinerama) selection.
  - Screen-edge slide/collapse handle with zero-gap GTK CSS provider anchoring.
- **Icon Support**:
  - System icon theme lookup with automatic fallbacks.
  - Custom PNG icon folder support (`~/.config/tech-hud-iconbar/icons/` with fallback to `~/.azteker/icons/`).
  - Proportional icon scaling and strict Cairo boundary clipping.
- **Multi-Iconbar Support**:
  - Run multiple independent iconbars (`tech-hud-iconbar`, `tech-hud-iconbar 2`, `tech-hud-iconbar 3`, ...).
  - Independent configuration (`config_N.rc`) and settings (`settings_N.ini`) per instance.
  - Automatic startup scanning for all secondary instances.
  - Dedicated **Manage Bars** tab in the Settings dialog to launch, hide, or delete instances with confirmation dialogs.
- **Live Settings & Configuration Editor**:
  - Live-apply settings dialog with GTK Font Chooser (`Gtk.FontButton`) and font size controls.
  - Integrated GTK configuration text editor with **Save & Restart** workflow.

---

## Configuration (`config.rc`)

By default, instance #1 reads configuration from `~/.config/tech-hud-iconbar/config.rc` (with automatic fallback to `~/.azteker/config.rc`).

### Example `config.rc`:
```ini
[Launcher]
X=0
Y=100
SliderHeight=64
IconHeight=32
Padding=5
Xinerama=0

[buttons]
term = xterm
browser = firefox
files = thunar
folder = xfe
folder_mini = mini_filemanager
```

> **Note**: Line-by-line configuration parsing allows multiple buttons to share the same icon name (e.g. `folder` and `folder_mini` both resolve to `folder.png` in the custom icon directory).

---

## Usage & Controls

- **Left-Click (Icon Region)**: Launch the associated executable.
- **Left-Click (Handle Region)**: Expand or collapse the iconbar against the screen border.
- **Right-Click**:
  - **Settings...**: Open the live-apply graphical settings dialog.
  - **Create New Iconbar...**: Automatically spawn a new numbered iconbar instance.
  - **Edit Config (#N)**: Open the built-in configuration text editor.
  - **Collapse / Expand Bar**: Toggle the slide state.

---

## Building & Installation

### Dependencies (Debian / Ubuntu / Linux Mint)
```bash
sudo apt update
sudo apt install valac libgtk-3-dev libcairo2-dev libxcomposite-dev libx11-6
```

### Build & Install
```bash
make
sudo make install
```

### Uninstallation
```bash
sudo make uninstall
```

---

## Packaging

- **Debian Package (`.deb`)**:
  ```bash
  make deb
  ```
  Generates `tech-hud-iconbar_1.0.1_amd64.deb`.

- **Source Archive (`.tar.gz`)**:
  ```bash
  make source
  ```
  Generates `tech-hud-iconbar-1.0.1.tar.gz`.

---

## Changelog

### Version 1.0.1
- **PID Lockfile Management**: Replaced `/proc/cmdline` string parsing with instance PID lockfiles (`~/.config/tech-hud-iconbar/instance_N.pid`) for deterministic, O(1) multi-instance tracking and lifecycle management.
- **GTK Argument Mutation Fix**: Resolved issue where `Gtk.init` modified `argv` in process memory, stripping `--instance` arguments from process memory space.
- **Multi-Instance Control Fix**: Fixed loop variable closure capture in the settings dialog's **Manage Bars** tab, ensuring **Hide / Close**, **Launch / Show**, and **Delete** actions reliably target their respective instances.
- **Absolute Executable Spawning**: Ensured all sub-process spawning uses absolute binary resolution via `/proc/self/exe` to reliably launch secondary iconbar instances.

---

## License

GPL-3.0-or-later
