# ahaasler/ulauncher-tmux architecture

> Architecture diagram of the GitHub repository ahaasler/ulauncher-tmux, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ahaasler/ulauncher-tmux
- Repository: https://github.com/ahaasler/ulauncher-tmux

## Overview

##### Main Components

a. User Interface Layer:
- Ulauncher Application (parent application)
- Extension UI Components (search interface)

b. Extension Core:
- Main Extension Handler (main.py)
- Configuration Manager (manifest.json)
- Version Control (versions.json)

c. External Systems:
- Terminal Emulator (configurable: gnome-terminal, kitty, konsole)
- Tmux Process Manager
- Tmux Sessions

- [Ulauncher App] ─────► [Extension UI] ─────► [Main Extension Handler]
- ▲                                            │

- ┘
- Events

- [Main Extension Handler] ───► [Terminal Emulator] ───► [Tmux Process]

- ▼
- [manifest.json] ◄────────────────────────────────► [Tmux Sessions]

##### Important Details

a. Command Flow:
- How search queries flow from Ulauncher to the extension
- How session creation/attachment commands are passed to the terminal

b. Configuration:
- How terminal emulator settings affect the command execution
- Relationship between manifest.json and the extension behavior

c. Session Management:
- Session discovery process
- Creation/attachment flow for Tmux sessions

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#e67e22,stroke:#d35400,color:white
    classDef data fill:#9b59b6,stroke:#8e44ad,color:white
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:white

    %% UI Layer
    subgraph UI
        UA[Ulauncher App]:::ui
        EUI[Extension UI]:::ui
    end

    %% Core Layer
    subgraph Core
        MEH[Main Extension Handler]:::core
        CM[Configuration Manager]:::core
        VC[Version Control]:::core
    end

    %% External Systems
    subgraph External
        TE[Terminal Emulator]:::external
        TM[Tmux Process]:::external
    end

    %% Data Layer
    subgraph Sessions
        TS[Tmux Sessions]:::data
    end

    %% Connections
    UA --> EUI
    EUI --> MEH
    MEH --> TE
    TE --> TM
    TM --> TS
    MEH --> CM
    CM --> TS
    MEH --> VC
    UA -.-> |Events| MEH

    %% Click Events
    click MEH "https://github.com/ahaasler/ulauncher-tmux/blob/main/main.py"
    click CM "https://github.com/ahaasler/ulauncher-tmux/blob/main/manifest.json"
    click VC "https://github.com/ahaasler/ulauncher-tmux/blob/main/versions.json"

    %% Legend
    subgraph Legend
        L1[UI Components]:::ui
        L2[Core Components]:::core
        L3[External Systems]:::external
        L4[Data Stores]:::data
        L5[Configuration]:::config
    end

    %% Notes
    classDef note fill:#fff,stroke:#ccc
    N1[Terminal Options:<br/>gnome-terminal<br/>kitty<br/>konsole]:::note
    TE --- N1
```
