Skip to content

Lock instead of suspending on the IdeaPad Slim 3 15AMN8 - #13115

Open
surim0n wants to merge 5 commits into
omacom:quattrofrom
surim0n:fix/ideapad-suspend
Open

surim0n wants to merge 5 commits into
omacom:quattrofrom
surim0n:fix/ideapad-suspend

Conversation

@surim0n

@surim0n surim0n commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

On the IdeaPad Slim 3 15AMN8 (Lenovo 82XQ), s2idle is the only sleep state and the Micron NVMe firmware rejects all I/O with Access Denied (sct 0x2 / sc 0x86) DNR ~0.5 s after resume — btrfs remounts root read-only, and the machine needs a hard power cycle. The failure presents as a black screen or a lock screen that never accepts a password (PAM can't read the disk), so it gets debugged as a compositor bug.

Per the reporter's suggested fallback: HandleLidSwitch=lock is strictly better than ignore — the session locks and the panel powers down (what a user expects from closing a laptop) while the filesystem stays alive. Hibernate was considered but the reporter's own attempt cold-booted on tight swap, so lock is the safe default.

  • New install/hardware/fix-ideapad-suspend.sh writes /etc/systemd/logind.conf.d/50-ideapad-suspend.conf only when DMI identifies LENOVO/82XQ, registered in install/hardware/all.sh
  • Migration applies the same drop-in on existing installs and reloads logind (not restart — restarting logind tears down the session)
  • Both paths gated on OMARCHY_DMI_PATH/OMARCHY_LOGIND_CONF_DIR for testing

Fixes #12887

Test plan

  • New test/shell.d/ideapad-suspend-test.sh: drop-in written on matching DMI, untouched on other models, migration applies it once and no-ops on repeat/unmatched runs (6 assertions, all passing)

Generated with Devin

The Lenovo 82XQ only offers s2idle, and its Micron NVMe firmware
rejects every I/O with Access Denied/DNR after resume, taking the root
filesystem read-only mid-session. The failure presents as a black
screen or a lock that never accepts a password, so it gets debugged as
a compositor bug.

On this model, write a logind drop-in that locks on lid close and on
the suspend key instead of suspending: the session locks and the panel
powers down, which is what a user expects from closing a laptop, and
the filesystem stays alive. Written by the hardware install step and
by a migration for existing installs.

Fixes omacom#12887
@llstrk

llstrk commented Sep 25, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Verified: the drop-in is valid and reaches the right machines. On a LENOVO/82XQ DMI match, both the installer leaf and the migration write the same [Login] drop-in. The keys and lock values are valid in systemd v262, and no Omarchy-shipped logind drop-in overrides them. systemctl reload systemd-logind re-reads drop-ins without ending the session. The new test passes on this head (6/6) and fails on the base.

Four points are worth addressing: the migration can record itself as done without applying the fix, several suspend paths stay reachable, the docked-lid key works against Omarchy's clamshell design, and the test calls the real systemctl and has two assertions that cannot fail.

Migration is marked complete when sudo fails

migrations/1790227635.sh line 16 is sudo install -d -m 0755 "$conf_dir" || exit 0. If that sudo fails (wrong password three times, cancelled prompt), the script exits 0 and omarchy-migrate writes its completion marker.

sudo install -d  -> fails
  || exit 0      -> migration exits 0
omarchy-migrate  -> marker written, no drop-in
--pending        -> nothing pending, never retried

In an isolated run through the real bin/omarchy-migrate with a failing sudo stub, the marker was written with no drop-in, and --pending listed nothing. A failing sudo tee on line 17, by contrast, correctly left the migration pending. Line 29 also ignores a failed reload (|| true), so logind can keep suspending on lid close until its next restart, and the early -f check stops a later run from retrying the reload.

Impact: on an affected 82XQ, one failed sudo prompt permanently skips the fix for that user, which leaves lid-close suspend and the read-only-root failure in place. This conflicts with agents/skills/migrations.md ("A migration that cannot finish must exit non-zero, remain pending, and stop the queue").

Suggested change: drop || exit 0 from line 16 so -e stops the queue. For the reload, consider the pattern in migrations/1784970000.sh: check the effective logind setting and set reboot-required when it does not match.

Other suspend paths remain reachable on the 82XQ

The code comments say suspend "can never succeed on this model", but the drop-in only changes logind's handling of the lid and the suspend key:

Path After this PR (source, systemd v262)
Lid close, undocked lock, no suspend
Suspend key, short or long press lock, no suspend
System menu > Suspend (omarchy-menu.jsonc) runs systemctl suspend, still suspends
Direct systemctl suspend (the issue's own reproduction) still suspends
Hibernate key, default HandleHibernateKey=hibernate, hibernation not set up logind falls back to regular suspend

Whether the 82XQ keyboard has a hibernate key was not verified.

Impact: an 82XQ user who picks Suspend from the System menu still hits the NVMe failure the PR is meant to prevent.

Suggested change: if the goal is that this model never suspends, a /etc/systemd/sleep.conf.d/ drop-in with [Sleep] AllowSuspend=no covers every row above in systemd v262. systemctl suspend then fails with "Sleep verb 'suspend' is disabled by config", and logind ignores suspend from the lid and keys, while hibernate stays available. The menu entry would still be shown unless it is hidden separately. If the narrower scope is intentional, rewording the comments to name the lid and suspend key would avoid overstating the protection.

HandleLidSwitchDocked=lock inverts the clamshell design

logind's default for HandleLidSwitchDocked is already ignore, so a docked lid close never suspended and this line adds no protection. bin/omarchy-system-lid-close states the intended policy: a docked lid close "does not suspend (HandleLidSwitchDocked defaults to ignore), so it must not lock either: that is clamshell mode".

logind's lock action only emits the org.freedesktop.login1.Session.Lock D-Bus signal. No listener for it was found in the Omarchy shell or Hyprland sources at this head, so today the docked setting has no visible effect. The visible lock and panel-off on an undocked lid close come from Omarchy's own Lid Switch binding (omarchy-system-lid-close → omarchy-system-lock), not from the drop-in. For the same reason, a suspend-key press now produces no visible lock.

Impact: any component that later honours logind's Lock signal would lock the external display in clamshell mode, against the policy above.

Suggested change: drop HandleLidSwitchDocked=lock from both scripts. The issue recommended that key for the hibernate workaround, where it is needed; for lock it is not.

Test calls the host's systemctl, and two assertions cannot fail

The first migration run uses a pass-through sudo stub (exec "$@") and no systemctl stub, so line 29 runs the real systemctl reload systemd-logind on the machine running ./test/shell. In an isolated run, a recording stub logged exactly that call. On a desktop this is expected to raise a polkit prompt (not observed live); as root it would reload logind. docs/testing.md asks tests not to touch the developer's machine.

Separately, the "idempotent once the drop-in exists" and "no-op on unmatched hardware" checks use a sudo stub that exits 1, but line 16's || exit 0 turns that into success. With the -f guard (line 14) or the DMI guards (lines 12-13) deleted in isolated mutation runs, the test still passed 6/6; the stub's "sudo must not run" message went to stderr unchecked. The [Login] header, HandleSuspendKeyLongPress and the reload are also never asserted.

Suggested change: add a logging systemctl stub to $tmp_dir/bin, make both stubs append their arguments to a call log (the pattern in docs/testing.md), and assert the log is empty for the rerun and unmatched cases and contains the reload for the first run. Fixing line 16 as suggested above would also make the current failing-stub checks fail as intended.


Review information

Test scope: Source review of the changed scripts, Omarchy's installer, migration, lid, lock, idle and menu paths at this head, and systemd v262 logind source (the version Arch currently packages). Isolated command-only runs with stubbed sudo, systemctl and helpers, synthetic DMI and logind config directories: the PR test on head and base, guard-removal mutations, the migration through the real omarchy-migrate runner, and the installer leaf through run_logged. No 82XQ hardware, live session, logind daemon or suspend/resume was tested. Whether every 82XQ SKU shares the reported drive fault was not assessed.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@surim0n

surim0n commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, both points addressed in 14dd521:

  • Dropped HandleLidSwitchDocked=lock from the installer leaf and the migration. You are right that for lock it is not needed and would lock an external display in clamshell mode.
  • The test no longer reaches the host: sudo and systemctl are now logging stubs, the first migration run asserts the reload systemd-logind call, and the rerun and unmatched-hardware cases assert no privileged command runs at all. The [Login] header and HandleSuspendKeyLongPress are also asserted now.

@llstrk

llstrk commented Sep 27, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Follow-up at 14dd5215 to the earlier review and the author's reply. Two of the four earlier findings are resolved and two are unchanged. No regressions from the new commit were found.

Earlier finding Status at 14dd5215
HandleLidSwitchDocked=lock inverts the clamshell design Resolved
Test calls the host's systemctl; two assertions cannot fail Resolved (small remaining test gap, below)
Migration is marked complete when sudo fails Still present
Other suspend paths remain reachable on the 82XQ Still present

Verified:

  • HandleLidSwitchDocked=lock is gone from both scripts, so a docked lid close keeps logind's default ignore. The test asserts the key is absent from the installer's drop-in.
  • In an isolated run with a canary sudo/systemctl placed first on the PATH the test inherits, the new test never reached the canary and passed 6/6. The previous test called it once (systemctl reload systemd-logind).
  • Each of these mutations now fails the test, as intended:
    • removing the migration's -f guard or its DMI guards
    • removing the reload, or changing it to restart
    • removing [Login] or HandleSuspendKeyLongPress=lock from the installer's drop-in
  • Apart from the two removed lines and the test rewrite, the installer and migration are byte-identical to the previously reviewed head.

The reply's statement that [Login] and HandleSuspendKeyLongPress are now asserted holds for the installer's drop-in only (see the test note below).

Migration is still marked complete when sudo fails

migrations/1790227635.sh line 16 is unchanged: sudo install -d -m 0755 "$conf_dir" || exit 0. The runner (bin/omarchy-migrate lines 91-95) writes the completion marker whenever a migration exits 0. The reload on line 28 still ends in >/dev/null 2>&1 || true.

Isolated runs through the real bin/omarchy-migrate at this head, with stubbed sudo/systemctl and synthetic LENOVO/82XQ DMI:

Case migrate exit Marker Drop-in --pending
every sudo call fails 0 written absent nothing listed
only sudo tee fails 1 none absent lists the migration
reload fails 0 written present nothing listed, no message
|| exit 0 removed, sudo fails 1 none absent lists the migration

Impact: on an affected 82XQ, one failed password prompt (for example from the login notifier or a manual omarchy-migrate) permanently skips the fix for that user. This conflicts with agents/skills/migrations.md line 129 ("A migration that cannot finish must exit non-zero, remain pending, and stop the queue"). During omarchy update, sudo is usually already authenticated by the package step, so that path is less likely to hit it.

Suggested change: drop || exit 0 from line 16. The current test still passes 6/6 with that change. For the reload, the pattern in migrations/1784970000.sh lines 18-25 applies: logind exposes HandleLidSwitch as a property, so the migration can compare it and set reboot-required on a mismatch.

Other suspend paths still reach suspend on the 82XQ

Nothing in this area changed. The drop-in covers only logind's lid and suspend-key handling. The System menu's Suspend entry (default/omarchy/omarchy-menu.jsonc line 38) still runs systemctl suspend, and systemctl suspend still suspends. In systemd v262, the hibernate key falls back to regular suspend when hibernation is not set up, and hibernation is opt-in in Omarchy. The code comments still say suspend "can never succeed on this model". Whether the 82XQ keyboard has a sleep or hibernate key was not verified.

Two open PRs would also bypass this drop-in on the 82XQ if they merge (from the PR diffs and systemd v262 source; not run):

Open PR Effect on an undocked 82XQ with this PR
#12210 (lid-close debounce) Its lid helper runs systemctl suspend after about 3 s unless suspend-off is enabled, on battery and on AC
#12125 (lid sleep policy), hibernation set up Its 99-omarchy-lid-sleep.conf sorts after 50-ideapad-suspend.conf: suspend-then-hibernate on battery, suspend on AC

Impact: a user on an affected 82XQ who picks Suspend from the System menu still hits the NVMe failure the PR is meant to prevent. The same applies to lid close if either PR above merges, under the conditions in the table.

Suggested change: if the goal is that this model never suspends, a model-gated /etc/systemd/sleep.conf.d/ drop-in with [Sleep] AllowSuspend=no covers every path above, whatever the logind drop-in order:

  • By default it also disallows suspend-then-hibernate and hybrid sleep. Hibernate stays available.
  • logind ignores a disallowed lid or key action.
  • systemctl suspend fails with "Sleep verb 'suspend' is disabled by config".
  • The sleep config is re-read on every request, so this needs no logind reload.
  • Setting AllowSuspendThenHibernate=no and AllowHybridSleep=no explicitly also overrides sleep.conf or an earlier-sorting drop-in that turns them on.

To also hide the menu entry, the migration (which runs per user) could set Omarchy's existing suspend-off toggle. If the narrower lid-and-key scope is intentional, rewording the comments would avoid overstating the protection.

Optional test improvement: the test checks the migration's drop-in only for HandleLidSwitch=lock (line 78). In mutation runs, removing [Login], HandleSuspendKey=lock or HandleSuspendKeyLongPress=lock from the migration's heredoc, or adding HandleLidSwitchDocked=lock there, still passed 6/6. The two heredocs are byte-identical today, but nothing enforces that. A cmp "$dropin" "$migration_dropin" would cover it. A failing-sudo case that expects a non-zero migration exit would lock in the fix above.

Open question, drive or model: issue #12887 documents one unit, with Micron MTFDKCD512QGN-1BN1AABLA firmware 1001V8LN, and attributes the fault to that drive's firmware. Lenovo's PSREF for the IdeaPad Slim 3 15AMN8 lists 128 GB to 1 TB SSD options in one M.2 slot, so this model ships with more than one drive. The PR gates on LENOVO/82XQ only. If the fault is drive-specific, unaffected 82XQ units lose lid-close suspend for no benefit. One report cannot settle whether it is. Reports from 82XQ units with other drives would. Options: also match /sys/class/nvme/nvme*/model (and optionally firmware_rev), or state the model-wide assumption in the comments.


Review information

Test scope: Follow-up of 14dd5215 against the earlier review at 1fdf5c45. Source review of the changed scripts, Omarchy's migration runner, installer logging, lid, menu and hibernation paths at this head, systemd v262 logind and sleep source, and open PRs #12125 and #12210 at their current heads. Isolated command-only runs with stubbed sudo, systemctl and helpers, and synthetic DMI and logind directories:

  • the PR test on head, the previous head and the base, with a PATH canary
  • guard, content and reload mutations
  • the migration through the real omarchy-migrate
  • the installer leaf through run_logged

The interactions with the open PRs are source-derived, not run. No 82XQ hardware, live logind daemon, reload or suspend/resume was tested.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
omarchybot and others added 2 commits October 3, 2026 03:18
`|| exit 0` after `sudo install -d` turned a cancelled or failed password prompt into success, so omarchy-migrate wrote the completion marker without the drop-in and the fix never ran again for that user. Let -e stop it instead, as agents/skills/migrations.md asks, and test the refusal the way omarchy-migrate runs the script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`|| true` let a failed reload pass silently: the drop-in was on disk, the migration was marked done, and logind kept suspending on lid close until the next boot. Set reboot-required instead, as migration 1784970000 does for its own logind drop-in, and assert the denied-sudo case actually reached sudo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at b4d3646b6d61a0b0cdb64d8fa8cf0e9f5536e372, by Claude Opus 5.5 and, as a second opinion, Codex Medium. This is a hardware fix, so it is not verified until the reporter of #12887 confirms it on the 82XQ. Steps for that are below.

What was checked. The change was run on a disposable Omarchy VM (systemd 261). There, running the migration under bash -euo pipefail with an 82XQ DMI fixture writes the drop-in, reloads logind without ending the session, and changes logind's HandleLidSwitch, HandleSuspendKey and HandleSuspendKeyLongPress from suspend/suspend/hibernate to lock, while HandleLidSwitchDocked stays ignore. A second run does nothing. On any other model, both scripts leave the machine untouched. test/shell.d/ideapad-suspend-test.sh passes 8/8. ./test/cli has one failure, vscode generated theme references current theme file, which fails the same way on this branch's merge base and is unrelated to this change. Lid close keeps locking, because Omarchy's own Lid Switch binding (omarchy-system-lid-close) locks an undocked laptop whatever logind does. With this drop-in, logind no longer suspends behind that lock.

Pushed to this branch, two commits:

  • 8825b92 makes migrations/1790227635.sh stop when sudo is refused. || exit 0 after sudo install -d turned a cancelled password prompt into success, so omarchy-migrate marked the migration done without writing the drop-in, and the fix never ran again for that user. This is what @llstrk's review flagged, and agents/skills/migrations.md asks for the same.
  • b4d3646 sets reboot-required when the logind reload fails, as migrations/1784970000.sh does, rather than || true. Before, a failed reload left the drop-in on disk with the migration marked done, while logind kept suspending on lid close until the next boot. Codex raised this one.

Each commit comes with a test case, and each case fails with its fix reverted. On the second round, Codex found nothing further.

Still open, for the author. HandleSuspendKey=lock and HandleSuspendKeyLongPress=lock stop the suspend key from suspending, but they do not lock the session. logind's lock action only emits the Session.Lock D-Bus signal, and nothing in Omarchy listens for it: omarchy-system-sleep-monitor watches PrepareForSleep only. On an 82XQ, pressing the suspend key with the lid open now does nothing visible. That is safer than suspending, but it is not what the comments in both scripts say. Either ignore and a comment saying so, or a listener for that signal, would make the two agree. Which one is a design call, so it was not pushed.

For the maintainer. The drop-in covers the lid and the suspend key only. System menu → Suspend still runs systemctl suspend. A plain systemctl suspend still suspends, and so does the hibernate key when hibernation is not set up. Each of those still triggers the NVMe failure on this model. #13260 turns sleep off for the DGX Spark with a sleep.conf.d drop-in (AllowSuspend=no) and hides the menu entries, which would close these paths as well. Whether this model should go the same way is your call. The gate is also on LENOVO/82XQ, not on the drive. #12887 documents one unit, with a Micron MTFDKCD512QGN on firmware 1001V8LN, so 82XQ units with another drive would lose lid-close suspend too.

@Chillbruhhh, could you confirm this on your 82XQ? Your confirmation is what this waits on.

  1. Move your own logind drop-ins aside first. 50-lid-hibernate.conf sorts after 50-ideapad-suspend.conf, so it would override this one: sudo mv /etc/systemd/logind.conf.d/{40-no-suspend,50-lid-hibernate}.conf /root/ 2>/dev/null; sudo systemctl reload systemd-logind
  2. Run the migration from this exact commit: git clone https://github.com/surim0n/omarchy.git /tmp/omarchy-13115 && git -C /tmp/omarchy-13115 checkout b4d3646b6d61a0b0cdb64d8fa8cf0e9f5536e372 && bash -euo pipefail /tmp/omarchy-13115/migrations/1790227635.sh
  3. busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager HandleLidSwitch should print s "lock".
  4. With no external display attached, close the lid for a minute, then open it. The lock screen should accept your password, findmnt -no OPTIONS / should still start with rw, and sudo dmesg | grep -i "access denied" should print nothing.

Please reply here with what you saw. If the branch moves again, the confirmation needs to be against the new commit.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Hardware-specific suspend behavior for one laptop model.

The suspend-key change addresses the first finding, but the migration’s retry problem still blocks merging.

Findings

  1. P1 Retry skips unfinished repair ▶

Summary

The latest changes make the IdeaPad’s suspend key do nothing instead of requesting a lock.

  • The installer and migration set both short and long suspend-key presses to ignore.
  • Lid-close behavior remains lock.
  • The shell tests now check the revised settings in both paths.

Reviews (2) · Last reviewed commit: "Ignore IdeaPad suspend key"

Comment thread install/hardware/fix-ideapad-suspend.sh Resolved
Comment thread migrations/1790227635.sh

[[ -r $dmi/sys_vendor && -r $dmi/product_name ]] || exit 0
[[ $(<"$dmi/sys_vendor") == "LENOVO" && $(<"$dmi/product_name") == "82XQ" ]] || exit 0
[[ -f $dropin ]] && exit 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Retry skips unfinished repair

The migration treats any existing $dropin as a completed repair. If an update stops after sudo tee creates the file but before the reload or reboot notice, the next run exits here and records success without applying the settings. A failed write can also leave an empty or incomplete file that gets skipped forever.

Check the required contents and finish the reload or reboot notice on retries. Write through a temporary file followed by a rename so a failed write cannot leave a partial repair.

Knowledge Base Used: Migration framework

Co-Authored-By: Saurabh Suri <suritech@gmail.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at e5e0dfa25ce8d7c2d9d1974497478d0b147ae8cd, by Claude Opus 5.5 and, as a second opinion, Codex Medium. Only the new commit was new to us. It settles the point left open last time: the suspend key is now ignore rather than lock, and the comments in both scripts and the drop-in now say what happens. This is still a hardware fix, so it is not verified until the reporter of #12887 confirms it on an 82XQ, and the confirmation has to be for this new commit.

What was checked. The tests ran on a disposable Omarchy VM (systemd 261). Running the migration under bash -euo pipefail with an 82XQ DMI fixture writes the drop-in and reloads logind, and the session stays up. logind then reports HandleLidSwitch=lock, HandleSuspendKey=ignore and HandleSuspendKeyLongPress=ignore, where it had suspend/suspend/hibernate, and HandleLidSwitchDocked stays ignore. A second run does nothing, and no reboot is requested. test/shell.d/ideapad-suspend-test.sh passes 8/8. ./test/cli has one failure, vscode generated theme references current theme file. It also fails on this branch's merge base and has nothing to do with this change. Codex checked systemd's button and action handling: with both keys set to ignore, logind does nothing at all on the suspend key. Neither of us found anything else wrong with the new commit. Codex's agreement was not independent: it could read this review.

Greptile's retry finding holds, but it is unlikely to happen. migrations/1790227635.sh:15 takes an existing drop-in to mean the job is done. Suppose an update is interrupted after sudo tee writes the file and before the reload. The next run then exits 0, and omarchy-migrate marks it done without reloading logind. The setting still takes effect at the next boot. A tee that fails partway through could leave a short file that is never rewritten, but the file is a few hundred bytes written in one go, so that is close to impossible in practice. Checking the file's contents rather than whether it exists would close both cases. That is optional, so nothing was pushed.

For the maintainer, unchanged from the last review: the drop-in covers the lid and the suspend key only. System menu → Suspend and a plain systemctl suspend still suspend this model into the NVMe failure, and so does the hibernate key when hibernation is not set up. The gate is also the model, LENOVO/82XQ, not the drive. #12887 documents one unit, with a Micron MTFDKCD512QGN.

@Chillbruhhh, could you confirm this commit on your 82XQ? This is what the pull request waits on.

  1. Move aside your own logind drop-ins, and the one from the earlier test commit if you ran it. The migration skips if its file already exists: sudo mv /etc/systemd/logind.conf.d/{40-no-suspend,50-lid-hibernate,50-ideapad-suspend}.conf /root/ 2>/dev/null; sudo systemctl reload systemd-logind
  2. Run the migration from this exact commit: rm -rf /tmp/omarchy-13115 && git clone https://github.com/surim0n/omarchy.git /tmp/omarchy-13115 && git -C /tmp/omarchy-13115 checkout e5e0dfa25ce8d7c2d9d1974497478d0b147ae8cd && bash -euo pipefail /tmp/omarchy-13115/migrations/1790227635.sh
  3. busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager HandleLidSwitch HandleSuspendKey should print s "lock" and s "ignore".
  4. With no external display attached, close the lid for a minute, then open it. The lock screen should accept your password, findmnt -no OPTIONS / should still start with rw, and sudo dmesg | grep -i "access denied" should print nothing.

Please reply here with what you saw.

@Chillbruhhh

Copy link
Copy Markdown

I'm the reporter of #12887. Tested e5e0dfa on my 82XQ (BIOS L1CN47WW, Micron MTFDKCD512QGN fw 1001V8LN, kernel 7.2.7-1-omarchy-rc1). It works as described.

  • Moved my own logind drop-ins aside (40-no-suspend.conf, 45-lid-lock.conf; I never had 50-lid-hibernate), reloaded logind, ran the migration under bash -euo pipefail. It printed its message and wrote 50-ideapad-suspend.conf, which was then the only lid/suspend drop-in.
  • logind reports HandleLidSwitch=lock, HandleLidSwitchDocked=ignore, HandleSuspendKey=ignore, HandleSuspendKeyLongPress=ignore.
  • Undocked, lid closed ~4 min: journal shows Lid closed. → Locking sessions... → lock secure in under a second, and no PM: suspend entry (suspend_stats/success = 0). On open the password was accepted first try, / is still rw, and dmesg shows no Access Denied.

So it does what it says: closing the lid no longer takes the drive down. To be clear about the trade-off, though, the machine never sleeps now, so a closed lid keeps draining the battery at near-idle rate instead of s2idle rate.

Two requests:

  1. Could this be Refs #12887 rather than Fixes? This PR works around my issue rather than fixing it. The underlying bug (the NVMe rejecting all I/O after s2idle resume, on both the Omarchy and Arch 7.2.7 kernels) is still open with @kwilczynski, and I'd like Suspend unusable on Lenovo IdeaPad Slim 3 15AMN8: s2idle resume leaves NVMe rejecting all I/O, root goes read-only #12887 to stay open until that's understood.
  2. +1 to the maintainer note: System menu → Suspend and systemctl suspend still reach the failure on this machine. An AllowSuspend=no sleep.conf.d drop-in plus hiding the menu entry (as in Disable system sleep on GB10 machines #13260) would close those paths too.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks @Chillbruhhh, that is the test this was waiting on. Read by Claude Opus 5.5 and, as a second opinion, Codex Medium. The head is still e5e0dfa25ce8d7c2d9d1974497478d0b147ae8cd, so nothing new was run on a worker this time. What you saw matches what the drop-in should do: lid close locks with no PM: suspend entry, / stays rw, there is no Access Denied, and logind reports exactly the four values the drop-in sets. Codex found nothing in the diff beyond what the earlier reviews raised.

One thing before this counts as verified. Your reply names the commit as e5e0dfa. omabot only records a confirmation that names the full commit, so that it can't be mistaken for a different push later. Neither of us has any doubt it was this commit. If you reply with a line like "Confirmed on e5e0dfa", that is enough, with no need to test again.

On Fixes versus Refs, for @surim0n. Your point holds: this keeps the lid and the suspend key away from s2idle, but it does not fix the NVMe failing after resume. Codex pointed out that changing the description alone won't keep #12887 open. The first commit, 1fdf5c4, also says Fixes #12887 in its message, and quattro is the default branch, so merging that commit would close the issue anyway. Keeping it open would mean changing both. Whether this pull request should close #12887 is for the maintainer to decide.

For the maintainer, unchanged: System menu → Suspend and a plain systemctl suspend still reach the failure on this model. You also asked for an AllowSuspend=no drop-in in sleep.conf.d and a hidden menu entry, as #13260 does for the DGX Spark. That would be a change in scope for this pull request, so it is the maintainer's call. As you note, the trade-off is a closed lid that drains the battery at idle rate rather than at s2idle rate.

This now waits on your full-SHA reply, and then on the maintainer.

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

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suspend unusable on Lenovo IdeaPad Slim 3 15AMN8: s2idle resume leaves NVMe rejecting all I/O, root goes read-only

4 participants