# theassassin/appimagelauncher architecture

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

- Interactive diagram: https://gitdiagram.com/theassassin/appimagelauncher
- Repository: https://github.com/theassassin/appimagelauncher

## Overview

AppImageLauncher intercepts AppImage launches, runs unintegrated images or prompts users to integrate them, and provides desktop entries for later launching, updating, and removal. The CLI exposes integration and unintegration; a background daemon watches configured directories and handles additions and removals. Shared integration logic manages desktop resources and configuration, while the binfmt bypass helper launches AppImages through a patched runtime. The README documents update and removal capabilities, but their detailed implementation is only partially sampled; those links are shown at the documented capability level.

Main entry points: [`src/ui/main.cpp`](https://github.com/theassassin/appimagelauncher/blob/master/src/ui/main.cpp) (Launch interceptor), [`src/shared/shared.cpp`](https://github.com/theassassin/appimagelauncher/blob/master/src/shared/shared.cpp) (Integration and config), [`src/daemon/daemon.cpp`](https://github.com/theassassin/appimagelauncher/blob/master/src/daemon/daemon.cpp) (Directory daemon), [`src/cli/commands/CommandFactory.cpp`](https://github.com/theassassin/appimagelauncher/blob/master/src/cli/commands/CommandFactory.cpp) (Command factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch handling"]
  node_launcher["Launch interceptor<br/>[main.cpp]"]
  node_bypass["Runtime bypass<br/>[lib.cpp]"]
end

subgraph group_integration["Integration services"]
  node_shared["Integration and config<br/>[shared.cpp]"]
  node_trash["Trash management<br/>[trashbin.cpp]"]
end

subgraph group_background["Background management"]
  node_daemon_entry["Daemon entry<br/>[main.cpp]"]
  node_daemon["Directory daemon<br/>[daemon.cpp]"]
  node_watcher["Filesystem watcher"]
  node_worker["Deferred operations<br/>[worker.cpp]"]
end

subgraph group_interfaces["User interfaces"]
  node_cli["CLI entry<br/>[cli_main.cpp]"]
  node_command_factory["Command factory<br/>[CommandFactory.cpp]"]
  node_integrate_command["Integrate command"]
  node_unintegrate_command["Unintegrate command"]
  node_first_run["First-run prompt<br/>[first-run.cpp]"]
  node_integration_dialog["Integration dialog"]
  node_settings["Settings dialog"]
  node_updater["Update helper<br/>[update_main.cpp]"]
  node_remover["Removal helper<br/>[remove_main.cpp]"]
end

subgraph group_runtime["Runtime support"]
  node_translations["Translations"]
end

node_user(("Desktop user"))
node_appimage["AppImage file"]
node_desktop["Desktop launcher"]

node_user -->|"opens"| node_appimage
node_appimage -->|"invokes"| node_launcher
node_launcher -->|"executes via"| node_bypass
node_launcher -->|"integrates through"| node_shared
node_launcher -->|"prompts with"| node_first_run
node_launcher -->|"shows"| node_integration_dialog
node_launcher -->|"uses"| node_trash
node_launcher -->|"installs"| node_translations
node_cli -->|"dispatches through"| node_command_factory
node_command_factory -.->|"creates"| node_integrate_command
node_command_factory -.->|"creates"| node_unintegrate_command
node_integrate_command -->|"integrates through"| node_shared
node_unintegrate_command -->|"unintegrates through"| node_shared
node_daemon_entry -->|"starts"| node_daemon
node_daemon -->|"uses"| node_watcher
node_daemon -->|"uses"| node_worker
node_worker -->|"uses"| node_shared
node_daemon -->|"reads configuration"| node_shared
node_desktop -->|"launches update"| node_updater
node_updater -.->|"applies updates"| node_shared
node_desktop -->|"launches removal"| node_remover
node_remover -.->|"removes integration"| node_shared
node_integration_dialog -->|"adds entries"| node_desktop
node_settings -->|"configures"| node_shared

click node_launcher "https://github.com/theassassin/appimagelauncher/blob/master/src/ui/main.cpp"
click node_bypass "https://github.com/theassassin/appimagelauncher/blob/master/src/binfmt-bypass/lib.cpp"
click node_cli "https://github.com/theassassin/appimagelauncher/blob/master/src/cli/cli_main.cpp"
click node_command_factory "https://github.com/theassassin/appimagelauncher/blob/master/src/cli/commands/CommandFactory.cpp"
click node_integrate_command "https://github.com/theassassin/appimagelauncher/blob/master/src/cli/commands/IntegrateCommand.cpp"
click node_unintegrate_command "https://github.com/theassassin/appimagelauncher/blob/master/src/cli/commands/UnintegrateCommand.cpp"
click node_shared "https://github.com/theassassin/appimagelauncher/blob/master/src/shared/shared.cpp"
click node_trash "https://github.com/theassassin/appimagelauncher/blob/master/src/trashbin/trashbin.cpp"
click node_daemon_entry "https://github.com/theassassin/appimagelauncher/blob/master/src/daemon/main.cpp"
click node_daemon "https://github.com/theassassin/appimagelauncher/blob/master/src/daemon/daemon.cpp"
click node_watcher "https://github.com/theassassin/appimagelauncher/blob/master/src/fswatcher/filesystemwatcher.cpp"
click node_worker "https://github.com/theassassin/appimagelauncher/blob/master/src/daemon/worker.cpp"
click node_first_run "https://github.com/theassassin/appimagelauncher/blob/master/src/ui/first-run.cpp"
click node_integration_dialog "https://github.com/theassassin/appimagelauncher/blob/master/src/ui/integration_dialog.cpp"
click node_settings "https://github.com/theassassin/appimagelauncher/blob/master/src/ui/settings_dialog.cpp"
click node_updater "https://github.com/theassassin/appimagelauncher/blob/master/src/ui/update_main.cpp"
click node_remover "https://github.com/theassassin/appimagelauncher/blob/master/src/ui/remove_main.cpp"
click node_translations "https://github.com/theassassin/appimagelauncher/blob/master/src/i18n/translationmanager.cpp"

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_launcher,node_bypass,node_user toneBlue
class node_shared,node_trash toneAmber
class node_daemon_entry,node_daemon,node_watcher,node_worker toneMint
class node_cli,node_command_factory,node_integrate_command,node_unintegrate_command,node_first_run,node_integration_dialog,node_settings,node_updater,node_remover toneRose
class node_translations,node_appimage,node_desktop toneIndigo
```

## Components

### Launch handling

- [Launch interceptor](https://github.com/theassassin/appimagelauncher/blob/master/src/ui/main.cpp): `src/ui/main.cpp`
- [Runtime bypass](https://github.com/theassassin/appimagelauncher/blob/master/src/binfmt-bypass/lib.cpp): `src/binfmt-bypass/lib.cpp`

### Integration services

- [Integration and config](https://github.com/theassassin/appimagelauncher/blob/master/src/shared/shared.cpp): `src/shared/shared.cpp`
- [Trash management](https://github.com/theassassin/appimagelauncher/blob/master/src/trashbin/trashbin.cpp): `src/trashbin/trashbin.cpp`

### Background management

- [Daemon entry](https://github.com/theassassin/appimagelauncher/blob/master/src/daemon/main.cpp): `src/daemon/main.cpp`
- [Directory daemon](https://github.com/theassassin/appimagelauncher/blob/master/src/daemon/daemon.cpp): `src/daemon/daemon.cpp`
- [Filesystem watcher](https://github.com/theassassin/appimagelauncher/blob/master/src/fswatcher/filesystemwatcher.cpp): `src/fswatcher/filesystemwatcher.cpp`
- [Deferred operations](https://github.com/theassassin/appimagelauncher/blob/master/src/daemon/worker.cpp): `src/daemon/worker.cpp`

### User interfaces

- [CLI entry](https://github.com/theassassin/appimagelauncher/blob/master/src/cli/cli_main.cpp): `src/cli/cli_main.cpp`
- [Command factory](https://github.com/theassassin/appimagelauncher/blob/master/src/cli/commands/CommandFactory.cpp): `src/cli/commands/CommandFactory.cpp`
- [Integrate command](https://github.com/theassassin/appimagelauncher/blob/master/src/cli/commands/IntegrateCommand.cpp): `src/cli/commands/IntegrateCommand.cpp`
- [Unintegrate command](https://github.com/theassassin/appimagelauncher/blob/master/src/cli/commands/UnintegrateCommand.cpp): `src/cli/commands/UnintegrateCommand.cpp`
- [First-run prompt](https://github.com/theassassin/appimagelauncher/blob/master/src/ui/first-run.cpp): `src/ui/first-run.cpp`
- [Integration dialog](https://github.com/theassassin/appimagelauncher/blob/master/src/ui/integration_dialog.cpp): `src/ui/integration_dialog.cpp`
- [Settings dialog](https://github.com/theassassin/appimagelauncher/blob/master/src/ui/settings_dialog.cpp): `src/ui/settings_dialog.cpp`
- [Update helper](https://github.com/theassassin/appimagelauncher/blob/master/src/ui/update_main.cpp): `src/ui/update_main.cpp`
- [Removal helper](https://github.com/theassassin/appimagelauncher/blob/master/src/ui/remove_main.cpp): `src/ui/remove_main.cpp`

### Runtime support

- [Translations](https://github.com/theassassin/appimagelauncher/blob/master/src/i18n/translationmanager.cpp): `src/i18n/translationmanager.cpp`

### Other components

- **Desktop user**
- **AppImage file**
- **Desktop launcher**

## Connections

- Desktop user → AppImage file: opens
- AppImage file → Launch interceptor: invokes
- Launch interceptor → Runtime bypass: executes via (evidence: `src/ui/main.cpp`)
- Launch interceptor → Integration and config: integrates through (evidence: `src/ui/main.cpp`)
- Launch interceptor → First-run prompt: prompts with (evidence: `src/ui/main.cpp`)
- Launch interceptor → Integration dialog: shows (evidence: `src/ui/main.cpp`)
- Launch interceptor → Trash management: uses (evidence: `src/ui/main.cpp`)
- Launch interceptor → Translations: installs (evidence: `src/ui/main.cpp`)
- CLI entry → Command factory: dispatches through (evidence: `src/cli/cli_main.cpp`)
- Command factory → Integrate command: creates
- Command factory → Unintegrate command: creates
- Integrate command → Integration and config: integrates through (evidence: `src/cli/commands/IntegrateCommand.cpp`)
- Unintegrate command → Integration and config: unintegrates through (evidence: `src/cli/commands/UnintegrateCommand.cpp`)
- Daemon entry → Directory daemon: starts (evidence: `src/daemon/main.cpp`)
- Directory daemon → Filesystem watcher: uses
- Directory daemon → Deferred operations: uses
- Deferred operations → Integration and config: uses (evidence: `src/daemon/worker.cpp`)
- Directory daemon → Integration and config: reads configuration (evidence: `src/daemon/daemon.cpp`)
- Desktop launcher → Update helper: launches update
- Update helper → Integration and config: applies updates
- Desktop launcher → Removal helper: launches removal
- Removal helper → Integration and config: removes integration
- Integration dialog → Desktop launcher: adds entries
- Settings dialog → Integration and config: configures (evidence: `src/ui/settings_dialog.cpp`)
