Proof Portal

Project overview

Omarchy

ProbeLabs65 findings · 95 requirements

A proof layer — requirements, tests and verified fixes — for two of Omarchy's subsystems: the application menu (launcher scripts, QML model, JSONC config, search and selection) and the lock screen (lock scripts, QML, PAM authentication). Scope is deliberately limited to those components of omacom/omarchy; the rest of the distribution is not covered.

Inbox
ReportR-905GitHub issuePublicDecided· Out of scope

Zero-length internal-monitor-disable.lua wedges clamshell: lid-close becomes a no-op with no recovery path

Reported by patrykbart · filed Sep 6, 2026 · open at source

Decided: Out of scope — decided by agents · verified 3 days ago.

At a glance

1 · What is claimed?
Only the report text below — no validator has restated it as checkable claims yet.
2 · What does it affect?
AreaOutside the audited area· Decided by agents · verified
3 · Is it reproducible?
No validation has been run yet.
4 · What remains unclear?
  • Not validated yet: no claims, no reproducer.
5 · What happens next?
Decided by agents and verified by a second, independent agent — see the decision.

Original report

Zero-length internal-monitor-disable.lua wedges clamshell: lid-close becomes a no-op with no recovery pathrevision 1 · captured 2026-09-28 21:23 UTC via poll

Summary

A zero-length internal-monitor-disable.lua puts clamshell into a state it
cannot leave: closing the lid becomes a complete no-op, and nothing in the UI can
clear it while an external monitor is attached.

The flag file does two jobs at once — its existence is the signal the shell
helpers read, and its contents are the Lua that Hyprland applies. The
existence test is -f, not -s, so a zero-length file satisfies the signal
while applying nothing. The manual override then vetoes the automatic path
without substituting anything for it.

Steps to reproduce

Laptop with an external monitor attached, lid closed (clamshell active):

: > ~/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua
omarchy-hyprland-monitor-clamshell
hyprctl monitors all -j | jq -r '.[]|"\(.name) disabled=\(.disabled)"'

No crash or unclean shutdown is needed to reproduce — the empty file is the
entire precondition.

Expected

eDP-2 disabled=true — lid is shut and an external monitor is live, so the
internal panel should be off.

Actual

eDP-2 disabled=false, and no internal-monitor-clamshell.lua is written.

Controlled run on my machine, changing only the empty file between step 2 and
step 3 (same command both times):

precondition: lid=closed  clamshell=yes  external=yes

STEP 2: plant a ZERO-BYTE manual flag, then run reconciliation
    flag size: 0 bytes
    eDP-2 disabled=false        <-- lid shut, external live, panel still on
    clamshell flag written? NO

STEP 3: remove the husk, run the identical command again
    eDP-2 disabled=true

Why it happens

omarchy-hyprland-monitor-clamshell:

disable_internal() {
  [[ -n $INTERNAL ]] || exit 0
  [[ -f $MANUAL_DISABLE_FLAG ]] && return 0      # <-- husk satisfies this
  ...
}

omarchy-hyprland-toggle-enabled (and -disabled) test the same way:

[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.lua" ]]

So the empty file reads as "manual override active" everywhere, while
require_all loads it as valid-but-empty Lua that disables nothing.

There is no route back from the UI. `omarchy-hyprland-monitor-internal
recover` opens with:

recover() {
  omarchy-hyprland-monitor-external-active && return 0
  ...
}

— it deliberately declines to act while an external monitor is attached, which is
exactly the situation in which the bug is visible. enable_internal() is gated on
the same flag, so lid-open does not clear it either. The user has to find and
delete the file by hand, with no notification and no log line pointing at it.

No stock toggle source under default/hypr/toggles/ is zero-length, so an empty
flag is always corruption and never a legitimate state.

Suggested fix

Two parts, because the first alone is incomplete:

  1. Test flags with -s rather than -f in omarchy-hyprland-toggle-enabled,

omarchy-hyprland-toggle-disabled, and the MANUAL_DISABLE_FLAG /
CLAMSHELL_FLAG guards in omarchy-hyprland-monitor-clamshell.

  1. Write the flags atomically. omarchy-hyprland-toggle's on() (cp),

omarchy-hyprland-monitor-internal's off() (printf >) and
disable_internal() (printf >) can all be interrupted mid-write. Writing to
a temp file in the same directory and mv-ing it into place makes the flag
either absent or complete.

-s on its own still admits a partially written flag, which would pass the
size test and then fail as a Lua syntax error — taking the whole Hyprland config
down with it, which is worse than the current symptom. Hence part 2.

Environment

  • Omarchy: 4.0.2-1
  • Hyprland: 0.56.2 (commit efb5099)
  • Kernel: 7.1.9-arch1-2
  • Machine: ASUS ROG Zephyrus G14 GU405AR
  • CPU: Intel Core Ultra 9 386H
  • GPU: Intel Panther Lake iGPU + NVIDIA RTX 5070 Ti Mobile
  • Internal panel: eDP-2; external: DP-2 (3440x1440)

How I hit it

The husk appeared after a hard power-off that landed ~3s after a
Super+Ctrl+Delete laptop-display toggle. I can't prove the filesystem-level
mechanism that produced a zero-length file there, so I've left it out — the
defect above reproduces from an empty file regardless of how one comes to exist.

View raw text
## Summary

A **zero-length** `internal-monitor-disable.lua` puts clamshell into a state it
cannot leave: closing the lid becomes a complete no-op, and nothing in the UI can
clear it while an external monitor is attached.

The flag file does two jobs at once — its **existence** is the signal the shell
helpers read, and its **contents** are the Lua that Hyprland applies. The
existence test is `-f`, not `-s`, so a zero-length file satisfies the signal
while applying nothing. The manual override then vetoes the automatic path
without substituting anything for it.

## Steps to reproduce

Laptop with an external monitor attached, lid closed (clamshell active):

```bash
: > ~/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua
omarchy-hyprland-monitor-clamshell
hyprctl monitors all -j | jq -r '.[]|"\(.name) disabled=\(.disabled)"'
```

No crash or unclean shutdown is needed to reproduce — the empty file is the
entire precondition.

## Expected

`eDP-2 disabled=true` — lid is shut and an external monitor is live, so the
internal panel should be off.

## Actual

`eDP-2 disabled=false`, and no `internal-monitor-clamshell.lua` is written.

Controlled run on my machine, changing only the empty file between step 2 and
step 3 (same command both times):

```
precondition: lid=closed  clamshell=yes  external=yes

STEP 2: plant a ZERO-BYTE manual flag, then run reconciliation
    flag size: 0 bytes
    eDP-2 disabled=false        <-- lid shut, external live, panel still on
    clamshell flag written? NO

STEP 3: remove the husk, run the identical command again
    eDP-2 disabled=true
```

## Why it happens

`omarchy-hyprland-monitor-clamshell`:

```bash
disable_internal() {
  [[ -n $INTERNAL ]] || exit 0
  [[ -f $MANUAL_DISABLE_FLAG ]] && return 0      # <-- husk satisfies this
  ...
}
```

`omarchy-hyprland-toggle-enabled` (and `-disabled`) test the same way:

```bash
[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.lua" ]]
```

So the empty file reads as "manual override active" everywhere, while
`require_all` loads it as valid-but-empty Lua that disables nothing.

**There is no route back from the UI.** `omarchy-hyprland-monitor-internal
recover` opens with:

```bash
recover() {
  omarchy-hyprland-monitor-external-active && return 0
  ...
}
```

— it deliberately declines to act while an external monitor is attached, which is
exactly the situation in which the bug is visible. `enable_internal()` is gated on
the same flag, so lid-open does not clear it either. The user has to find and
delete the file by hand, with no notification and no log line pointing at it.

No stock toggle source under `default/hypr/toggles/` is zero-length, so an empty
flag is always corruption and never a legitimate state.

## Suggested fix

Two parts, because the first alone is incomplete:

1. Test flags with `-s` rather than `-f` in `omarchy-hyprland-toggle-enabled`,
   `omarchy-hyprland-toggle-disabled`, and the `MANUAL_DISABLE_FLAG` /
   `CLAMSHELL_FLAG` guards in `omarchy-hyprland-monitor-clamshell`.

2. Write the flags atomically. `omarchy-hyprland-toggle`'s `on()` (`cp`),
   `omarchy-hyprland-monitor-internal`'s `off()` (`printf >`) and
   `disable_internal()` (`printf >`) can all be interrupted mid-write. Writing to
   a temp file in the same directory and `mv`-ing it into place makes the flag
   either absent or complete.

`-s` on its own still admits a *partially* written flag, which would pass the
size test and then fail as a Lua syntax error — taking the whole Hyprland config
down with it, which is worse than the current symptom. Hence part 2.

## Environment

- Omarchy: 4.0.2-1
- Hyprland: 0.56.2 (commit efb5099)
- Kernel: 7.1.9-arch1-2
- Machine: ASUS ROG Zephyrus G14 GU405AR
- CPU: Intel Core Ultra 9 386H
- GPU: Intel Panther Lake iGPU + NVIDIA RTX 5070 Ti Mobile
- Internal panel: `eDP-2`; external: `DP-2` (3440x1440)

## How I hit it

The husk appeared after a hard power-off that landed ~3s after a
`Super+Ctrl+Delete` laptop-display toggle. I can't prove the filesystem-level
mechanism that produced a zero-length file there, so I've left it out — the
defect above reproduces from an empty file regardless of how one comes to exist.

Validation

Not checked yet. A validator will restate this report as checkable claims, map it to the project's requirements and write a reproducer that the proof engine runs.

Linked

Not linked to any known issue, other report or change yet.

Decision

Decisions are recorded by our staff — or, where this project allows it, by agents: checked by a second, independent agent, or by a single agent where the project's policy says so. Any decision reached so far is shown below.

  • Out of scopeDecided by agents · verified · 2026-10-09 10:57 UTC