# fthx/lock-guard architecture

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

- Interactive diagram: https://gitdiagram.com/fthx/lock-guard
- Repository: https://github.com/fthx/lock-guard

## Overview

Lock Guard is a small GNOME Shell extension that restricts lock-screen access to selected controls and reports repeated authentication failures. On enable, it saves and disables keybindings, hides Quick Settings, and connects to authentication failures; on disable, it restores the controls and reports failures if the threshold was reached. The only source file was excerpted, so the graph reflects its explicit interactions and does not infer broader GNOME internals.

Main entry points: [`extension.js`](https://github.com/fthx/lock-guard/blob/main/extension.js) (Extension lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_protection["Lock protection"]
  node_extension["Extension lifecycle<br/>[extension.js]"]
end

subgraph group_reporting["Failure reporting"]
  node_attempts["Failure counter<br/>[extension.js]"]
  node_report["Warning notification<br/>[extension.js]"]
end

subgraph group_shell["GNOME Shell"]
  node_auth["Auth verifier"]
  node_keybindings["Keybindings"]
  node_quicksettings["Quick Settings"]
  node_tray["Message tray"]
end

node_extension -->|"disables/restores"| node_keybindings
node_extension -->|"hides/shows"| node_quicksettings
node_extension -->|"connects to failures"| node_auth
node_auth -->|"signals failure"| node_attempts
node_extension -->|"checks on disable"| node_report
node_report -->|"adds warning"| node_tray

click node_extension "https://github.com/fthx/lock-guard/blob/main/extension.js"
click node_attempts "https://github.com/fthx/lock-guard/blob/main/extension.js"
click node_report "https://github.com/fthx/lock-guard/blob/main/extension.js"

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_extension toneBlue
class node_attempts,node_report toneAmber
class node_auth,node_keybindings,node_quicksettings,node_tray toneMint
```

## Components

### Lock protection

- [Extension lifecycle](https://github.com/fthx/lock-guard/blob/main/extension.js): `extension.js`

### Failure reporting

- [Failure counter](https://github.com/fthx/lock-guard/blob/main/extension.js): `extension.js`
- [Warning notification](https://github.com/fthx/lock-guard/blob/main/extension.js): `extension.js`

### GNOME Shell

- **Auth verifier**
- **Keybindings**
- **Quick Settings**
- **Message tray**

## Connections

- Extension lifecycle → Keybindings: disables/restores (evidence: `extension.js`)
- Extension lifecycle → Quick Settings: hides/shows (evidence: `extension.js`)
- Extension lifecycle → Auth verifier: connects to failures (evidence: `extension.js`)
- Auth verifier → Failure counter: signals failure (evidence: `extension.js`)
- Extension lifecycle → Warning notification: checks on disable (evidence: `extension.js`)
- Warning notification → Message tray: adds warning (evidence: `extension.js`)
