Skip to content

feat(lid-guard): add lid-close suspension inhibitor#30

Draft
8bury wants to merge 2 commits into
noctalia-dev:mainfrom
8bury:feat/lid-guard
Draft

feat(lid-guard): add lid-close suspension inhibitor#30
8bury wants to merge 2 commits into
noctalia-dev:mainfrom
8bury:feat/lid-guard

Conversation

@8bury

@8bury 8bury commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Plugin

  • Id: 8bury/lid-guard
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Lid Guard adds a bar indicator and optional Control Center shortcut for toggling
a lid-close inhibitor. When active, closing the laptop lid does not trigger
systemd-logind suspension, allowing AI agents, builds, downloads, and other
background jobs to keep running.

The plugin does not edit logind.conf, request elevated privileges, or block
explicit suspension. It inhibits only handle-lid-switch.

External dependencies

  • systemctl: checks, stops, and resets the transient user service.
  • systemd-run: creates noctalia-lid-guard.service in the current user's
    service manager.
  • systemd-inhibit: holds the handle-lid-switch inhibitor while the mode is
    active.
  • sleep: supplies the long-running process held by systemd-inhibit.

The plugin makes no network calls, downloads no code, and writes no files. All
spawned processes are listed above and run as the current user.

Testing

  • Enabled the plugin from both its Git source and a development checkout.

  • Added the bar widget and verified inactive, active, busy, and tooltip state
    rendering.

  • Dispatched status, enable, and disable to the service entry over IPC.

  • Confirmed noctalia-lid-guard.service becomes active after enabling.

  • Confirmed systemd-inhibit --list reports a blocking
    handle-lid-switch inhibitor owned by Noctalia Lid Guard.

  • Confirmed disabling removes the inhibitor and leaves the service inactive.

  • Ran the community repository validator successfully across all 16 manifests.

  • Ran all 19 validator unit tests successfully.

  • Left Lid Guard disabled after testing.

  • Tested on Niri

  • Tested on Hyprland

  • Tested on Sway

  • Tested on another compositor:

  • Noctalia version tested against: 5.0.0

  • Plugin API level: 3

Screenshots / Videos

Lid Guard plugin thumbnail

Checklist

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the
    README template, documents
    every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • I created thumbnail.webp with the thumbnail generator.
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I can read, write, and
    understand that language well enough to review and maintain it (no non-English translations are included).
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

Plugins run as trusted, unsandboxed Luau in the user's session. Confirm:

  • The code is readable and not obfuscated, minified, or generated.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant