# csiew/biscuitwm architecture

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

- Interactive diagram: https://gitdiagram.com/csiew/biscuitwm
- Repository: https://github.com/csiew/biscuitwm

## Overview

##### Main Components

a. Core Window Manager Components:
- X11 Server Interface
- Window Management System
- Event Handler
- Desktop Components (Deskbar)
- Configuration System

b. Supporting Systems:
- Session Management
- Key Binding System
- Window Layout Engine
- Preferences Handler

##### Connections

- Data flow between components
- Component dependencies
- Event propagation paths
- Configuration loading paths

##### Implementation Details

- The modular structure evident in the src/components directory
- The separation between models and components
- The utility functions and their relationships
- The configuration system's integration

##### Notes

- Event-driven nature of the window manager
- Relationship with the X11 server
- Configuration file locations
- Entry points (main.py and session management)
- Integration with external Python libraries

Remember to include the key features mentioned in the README, such as window manipulation, keyboard shortcuts, and the launcher mode, showing how they integrate with the core window management system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Foundation
        X11[X11 Server]:::external
        XLib[Python-Xlib Interface]:::external
        EWMH[EWMH Compliance Layer]:::external
        
        X11 --> XLib
        XLib --> EWMH
    end

    subgraph Core
        WMCore[Window Manager Core]:::core
        EventHandler[Event Handling System]:::core
        WinLogic[Window Management Logic]:::core
        
        EWMH --> WMCore
        WMCore --> EventHandler
        EventHandler --> WinLogic
    end

    subgraph "UI Components"
        Deskbar[Desktop Bar]:::ui
        DeskItems[Deskbar Items]:::ui
        DisplayCorners[Display Corners]:::ui
        
        WinLogic --> Deskbar
        Deskbar --> DeskItems
        DisplayCorners --> WinLogic
    end

    subgraph "User Interface"
        KeyHandler[Key Combinations Handler]:::input
        Session[Session Management]:::session
        Prefs[Preferences System]:::config
        Main[Main Entry Point]:::core
        Global[Global Configuration]:::config
        ConfigFile[Default Configuration]:::config
        ColorPalette[Color Palette System]:::ui
        Timer[Timer Utility]:::utility
        
        KeyHandler --> EventHandler
        Session --> Main
        Prefs --> Main
        Global --> Main
        ConfigFile --> Prefs
        ColorPalette --> Deskbar
        Timer --> EventHandler
    end

    %% Click events for component mapping
    click WMCore "https://github.com/csiew/BiscuitWM/blob/master/src/components/window_manager.py"
    click Deskbar "https://github.com/csiew/BiscuitWM/blob/master/src/components/deskbar.py"
    click DeskItems "https://github.com/csiew/BiscuitWM/blob/master/src/components/deskbar_item.py"
    click KeyHandler "https://github.com/csiew/BiscuitWM/blob/master/src/key_combs.py"
    click Session "https://github.com/csiew/BiscuitWM/blob/master/src/models/session_info.py"
    click Prefs "https://github.com/csiew/BiscuitWM/blob/master/src/utils/preferences.py"
    click DisplayCorners "https://github.com/csiew/BiscuitWM/blob/master/src/utils/display_corners.py"
    click Main "https://github.com/csiew/BiscuitWM/blob/master/src/main.py"
    click Global "https://github.com/csiew/BiscuitWM/blob/master/src/globals.py"
    click ConfigFile "https://github.com/csiew/BiscuitWM/blob/master/assets/biscuitwm.json"
    click ColorPalette "https://github.com/csiew/BiscuitWM/blob/master/src/models/pixel_palette.py"
    click Timer "https://github.com/csiew/BiscuitWM/blob/master/src/utils/repeated_timer.py"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef ui fill:#4CAF50,stroke:#2E7D32,color:white
    classDef config fill:#FFC107,stroke:#FFA000,color:black
    classDef external fill:#9E9E9E,stroke:#616161,color:white
    classDef session fill:#F44336,stroke:#C62828,color:white
    classDef utility fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef input fill:#00BCD4,stroke:#00838F,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[UI Elements]:::ui
        L3[Configuration]:::config
        L4[External Dependencies]:::external
        L5[Session Management]:::session
        L6[Utility Components]:::utility
        L7[Input Handling]:::input
    end
```
