# locupleto/the-gallery architecture

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

- Interactive diagram: https://gitdiagram.com/locupleto/the-gallery
- Repository: https://github.com/locupleto/the-gallery

## Overview

The Gallery is a macOS desktop experience assembled from hotkey, window-management, and Hammerspoon tools, with a command-line interface for configuration. Its user workflow begins at a keyboard shortcut and reaches tiling, menus, themed terminals, or plugins. The README documents the broad capabilities; sampled source confirms the QML host and shim behavior and theme renderer responsibilities. Some internal wiring is not shown in the excerpts, so uncertain connections are omitted.

Main entry points: [`qml/shim`](https://github.com/locupleto/the-gallery/tree/main/qml/shim) (Quickshell shim), [`tools/render-theme.py`](https://github.com/locupleto/the-gallery/blob/main/tools/render-theme.py) (Theme renderer), [`skhd/gallery.skhd`](https://github.com/locupleto/the-gallery/blob/main/skhd/gallery.skhd) (Hotkeys), [`bin/gallery`](https://github.com/locupleto/the-gallery/blob/main/bin/gallery) (Gallery CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Keys and commands"]
  node_skhd["Hotkeys<br/>[gallery.skhd]"]
  node_gallery["Gallery CLI"]
end

subgraph group_tiling["Tiling and focus"]
  node_tiler["Window tiling<br/>[tiler.skhd]"]
  node_yabai["yabai"]
  node_outline["Focus outline<br/>[outline.lua]"]
end

subgraph group_themes["Themes and terminals"]
  node_theme_cli["Theme commands"]
  node_renderer["Theme renderer<br/>[render-theme.py]"]
  node_theme_data["Theme palettes"]
  node_terminals["Terminal apps"]
  node_wallpaper["Wallpapers"]
end

subgraph group_menus["Menus and Hammerspoon"]
  node_spoon["Hammerspoon app<br/>[init.lua]"]
  node_menus["Menus and overlays<br/>[menu.lua]"]
  node_state["Desktop state<br/>[state.lua]"]
end

subgraph group_plugins["Plugin runtime"]
  node_plugin_cli["Plugin commands"]
  node_manifests["Plugin manifests"]
  node_qml_host["QML host<br/>[host.py]"]
  node_qml_shim["Quickshell shim"]
  node_shim_io["Process and files<br/>[quickshell_io.py]"]
  node_shim_core["Quickshell core<br/>[quickshell_core.py]"]
  node_shim_hyprland["Hyprland shim"]
  node_shim_wayland["Wayland shim"]
  node_jsvalue["QML value adapter<br/>[_jsvalue.py]"]
end

node_user(("User"))
node_external_plugins["Omarchy QML plugins"]

node_user -->|"presses keys"| node_skhd
node_skhd -->|"dispatches shortcuts"| node_tiler
node_tiler -->|"tiles windows"| node_yabai
node_skhd -->|"opens Learn"| node_menus
node_user -->|"runs commands"| node_gallery
node_gallery -->|"sets themes"| node_theme_cli
node_theme_cli -->|"renders theme"| node_renderer
node_theme_data -->|"supplies palette"| node_renderer
node_renderer -->|"configures terminals"| node_terminals
node_renderer -->|"renders outline colors"| node_outline
node_renderer -.->|"applies theme"| node_wallpaper
node_gallery -->|"runs plugin commands"| node_plugin_cli
node_plugin_cli -.->|"loads plugins"| node_manifests
node_external_plugins -->|"runs through host"| node_qml_host
node_qml_host -->|"registers and imports"| node_qml_shim
node_qml_shim -->|"registers type"| node_shim_io
node_qml_shim -->|"registers type"| node_shim_core
node_qml_shim -->|"registers type"| node_shim_hyprland
node_qml_shim -->|"registers type"| node_shim_wayland
node_shim_core -->|"converts values"| node_jsvalue
node_shim_io -->|"converts values"| node_jsvalue

click node_skhd "https://github.com/locupleto/the-gallery/blob/main/skhd/gallery.skhd"
click node_gallery "https://github.com/locupleto/the-gallery/blob/main/bin/gallery"
click node_tiler "https://github.com/locupleto/the-gallery/blob/main/tiler/tiler.skhd"
click node_outline "https://github.com/locupleto/the-gallery/blob/main/Gallery.spoon/lib/outline.lua"
click node_theme_cli "https://github.com/locupleto/the-gallery/blob/main/bin/gallery"
click node_renderer "https://github.com/locupleto/the-gallery/blob/main/tools/render-theme.py"
click node_theme_data "https://github.com/locupleto/the-gallery/tree/main/themes"
click node_wallpaper "https://github.com/locupleto/the-gallery/tree/main/plugins/gallery.backgrounds"
click node_spoon "https://github.com/locupleto/the-gallery/blob/main/Gallery.spoon/init.lua"
click node_menus "https://github.com/locupleto/the-gallery/blob/main/Gallery.spoon/lib/menu.lua"
click node_state "https://github.com/locupleto/the-gallery/blob/main/Gallery.spoon/lib/state.lua"
click node_plugin_cli "https://github.com/locupleto/the-gallery/blob/main/bin/gallery"
click node_manifests "https://github.com/locupleto/the-gallery/tree/main/plugins"
click node_qml_host "https://github.com/locupleto/the-gallery/blob/main/qml/host.py"
click node_qml_shim "https://github.com/locupleto/the-gallery/tree/main/qml/shim"
click node_shim_io "https://github.com/locupleto/the-gallery/blob/main/qml/shim/quickshell_io.py"
click node_shim_core "https://github.com/locupleto/the-gallery/blob/main/qml/shim/quickshell_core.py"
click node_shim_hyprland "https://github.com/locupleto/the-gallery/blob/main/qml/shim/quickshell_hyprland.py"
click node_shim_wayland "https://github.com/locupleto/the-gallery/blob/main/qml/shim/quickshell_wayland.py"
click node_jsvalue "https://github.com/locupleto/the-gallery/blob/main/qml/shim/_jsvalue.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skhd,node_gallery,node_user toneBlue
class node_tiler,node_yabai,node_outline toneAmber
class node_theme_cli,node_renderer,node_theme_data,node_terminals,node_wallpaper toneMint
class node_spoon,node_menus,node_state toneRose
class node_plugin_cli,node_manifests,node_qml_host,node_qml_shim,node_shim_io,node_shim_core,node_shim_hyprland,node_shim_wayland,node_jsvalue,node_external_plugins toneIndigo
```

## Components

### Keys and commands

- [Hotkeys](https://github.com/locupleto/the-gallery/blob/main/skhd/gallery.skhd): `skhd/gallery.skhd`
- [Gallery CLI](https://github.com/locupleto/the-gallery/blob/main/bin/gallery): `bin/gallery`

### Tiling and focus

- [Window tiling](https://github.com/locupleto/the-gallery/blob/main/tiler/tiler.skhd): `tiler/tiler.skhd`
- **yabai**
- [Focus outline](https://github.com/locupleto/the-gallery/blob/main/Gallery.spoon/lib/outline.lua): `Gallery.spoon/lib/outline.lua`

### Themes and terminals

- [Theme commands](https://github.com/locupleto/the-gallery/blob/main/bin/gallery): `bin/gallery`
- [Theme renderer](https://github.com/locupleto/the-gallery/blob/main/tools/render-theme.py): `tools/render-theme.py`
- [Theme palettes](https://github.com/locupleto/the-gallery/tree/main/themes): `themes`
- **Terminal apps**
- [Wallpapers](https://github.com/locupleto/the-gallery/tree/main/plugins/gallery.backgrounds): `plugins/gallery.backgrounds`

### Menus and Hammerspoon

- [Hammerspoon app](https://github.com/locupleto/the-gallery/blob/main/Gallery.spoon/init.lua): `Gallery.spoon/init.lua`
- [Menus and overlays](https://github.com/locupleto/the-gallery/blob/main/Gallery.spoon/lib/menu.lua): `Gallery.spoon/lib/menu.lua`
- [Desktop state](https://github.com/locupleto/the-gallery/blob/main/Gallery.spoon/lib/state.lua): `Gallery.spoon/lib/state.lua`

### Plugin runtime

- [Plugin commands](https://github.com/locupleto/the-gallery/blob/main/bin/gallery): `bin/gallery`
- [Plugin manifests](https://github.com/locupleto/the-gallery/tree/main/plugins): `plugins`
- [QML host](https://github.com/locupleto/the-gallery/blob/main/qml/host.py): `qml/host.py`
- [Quickshell shim](https://github.com/locupleto/the-gallery/tree/main/qml/shim): `qml/shim`
- [Process and files](https://github.com/locupleto/the-gallery/blob/main/qml/shim/quickshell_io.py): `qml/shim/quickshell_io.py`
- [Quickshell core](https://github.com/locupleto/the-gallery/blob/main/qml/shim/quickshell_core.py): `qml/shim/quickshell_core.py`
- [Hyprland shim](https://github.com/locupleto/the-gallery/blob/main/qml/shim/quickshell_hyprland.py): `qml/shim/quickshell_hyprland.py`
- [Wayland shim](https://github.com/locupleto/the-gallery/blob/main/qml/shim/quickshell_wayland.py): `qml/shim/quickshell_wayland.py`
- [QML value adapter](https://github.com/locupleto/the-gallery/blob/main/qml/shim/_jsvalue.py): `qml/shim/_jsvalue.py`

### Other components

- **User**
- **Omarchy QML plugins**

## Connections

- User → Hotkeys: presses keys (evidence: `README.md`)
- Hotkeys → Window tiling: dispatches shortcuts (evidence: `README.md`)
- Window tiling → yabai: tiles windows (evidence: `README.md`)
- Hotkeys → Menus and overlays: opens Learn (evidence: `README.md`)
- User → Gallery CLI: runs commands (evidence: `README.md`)
- Gallery CLI → Theme commands: sets themes (evidence: `README.md`)
- Theme commands → Theme renderer: renders theme (evidence: `README.md`)
- Theme palettes → Theme renderer: supplies palette (evidence: `tools/render-theme.py`)
- Theme renderer → Terminal apps: configures terminals (evidence: `tools/render-theme.py`)
- Theme renderer → Focus outline: renders outline colors (evidence: `tools/render-theme.py`)
- Theme renderer → Wallpapers: applies theme
- Gallery CLI → Plugin commands: runs plugin commands (evidence: `README.md`)
- Plugin commands → Plugin manifests: loads plugins
- Omarchy QML plugins → QML host: runs through host (evidence: `README.md`)
- QML host → Quickshell shim: registers and imports (evidence: `qml/host.py`)
- Quickshell shim → Process and files: registers type (evidence: `qml/shim/__init__.py`)
- Quickshell shim → Quickshell core: registers type (evidence: `qml/shim/__init__.py`)
- Quickshell shim → Hyprland shim: registers type (evidence: `qml/shim/__init__.py`)
- Quickshell shim → Wayland shim: registers type (evidence: `qml/shim/__init__.py`)
- Quickshell core → QML value adapter: converts values (evidence: `qml/shim/quickshell_core.py`)
- Process and files → QML value adapter: converts values (evidence: `qml/shim/quickshell_io.py`)
